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
Hello to anyone still getting here from google :) I'm using PHP 7.0.5 and PHPUnit 5.3.2.
As @hubro mentions - don't use __construct()
as it breaks some PHPUnit annotations. Here is a SO tread with more details.
My test's class, MyStuffTest
, extends MyFancyTestcase
which extends PHPUnit_Framework_TestCase
. MyFancyTestcase
used __construct()
and I got the same error. It should use setupBeforeClass()
instead to setup static data shared among all test cases - db connection and such, no need for __construct()
. DataProvider works now.
For me only removing the constructor has worked. Calling the parent constructor inside my class test broke the annotations as well even with the latest stable version of PHPUnit (6.0.9).
I just moved the code I had on __constructor
to the setUp
function that is called before my unit tests run.