-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
type/bugSomething is brokenSomething is broken
Description
| Q | A |
|---|---|
| PHPUnit version | 8.4.0 |
| PHP version | 7.3.9 |
| Installation Method | Composer |
Summary
Tests classes that contain a test method utilizing a data provider defined in a parent class will produce a warning.
Previous Behavior
No warnings will be shown
Current Behavior
Warning:
The data provider specified for FuTest::testFu is invalid.
Cannot instantiate abstract class AbstractFuTestCase
How to reproduce
abstract class AbstractFuTestCase extends \PHPUnit\Framework\TestCase
{
public function dataProvider(): array
{
return [
['fu'],
['bar'],
];
}
/**
* @dataProvider dataProvider
*/
public function testFu(string $bar): void
{
$this->assertTrue(true);
}
}
class FuTest extends AbstractFuTestCase
{
}Just run the FuTest
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/bugSomething is brokenSomething is broken