-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
I have a test which is using a data provider. It runs as expected when running the whole file, however the individual test filter does not account for data providers.
Example Test:
use Tests\TestCase;
class ExampleTest extends TestCase
{
function exampleDataProvider()
{
return [
['foo'],
];
}
/**
* @test
* @dataProvider exampleDataProvider
*/
function example_test($foo)
{
$this->assertSame('foo', $foo);
}
}
Output when running run_phpunit_test:
cd /Users/adamtomat/Sites/<repo> && /Users/adamtomat/Sites/<repo>/vendor/phpunit/phpunit/phpunit /Users/adamtomat/Sites/<repo>/tests/Feature/ExampleTest.php
OK (1 test, 1 assertion)
Output when running run_single_phpunit_test:
cd /Users/adamtomat/Sites/<repo> && /Users/adamtomat/Sites/<repo>/vendor/phpunit/phpunit/phpunit /Users/adamtomat/Sites/<repo>/tests/Feature/ExampleTest.php --filter '/::example_test$/'
No tests executed!
After a little searching around, it looks like the filter needs to account for tests with data providers, which explains why it doesn't work:
https://stackoverflow.com/questions/12193606/cannot-run-single-test-with-data-provider-in-phpunit
Metadata
Metadata
Assignees
Labels
No labels