PHPUnit @dataProvider simply doesn't work

前端 未结 8 1916
后悔当初
后悔当初 2021-02-01 16:04

I\'ve read the documentation on the topic, and my code follows all requirements of a data provider implementation. First of all, here\'s the full code of the test just in case i

8条回答
  •  自闭症患者
    2021-02-01 16:37

    Spent hours trying to figure out what's wrong with dataProvider annotation. It simply wasn't called at all.

    In my case problem was opcache. Check php.ini to make sure opcache.save_comments is enabled:

    php -r "phpinfo();" | grep opcache.save_comments
    

    To enable it add this to php.ini (or /usr/local/php5/php.d/20-extension-opcache.ini in my case because I'm using php for osx from liip.ch):

    [opcache]
    opcache.save_comments=1
    

提交回复
热议问题