You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A test with a dataProvider that returns an empty array normally generates a warning. But, when it is the only test, it does not generate a warning but is skipped instead. Example:
<?php/** * This is e.g. phpunit-test/FooTest.php * @group foo */class FooTest extends PHPUnit_Framework_TestCase
{
publicfunctiontestFoo()
{
$this->assertEquals(1, 1);
}
}
<?php/** * This is e.g. phpunit-test/BarTest.php * @group bar */class BarTest extends PHPUnit_Framework_TestCase
{
/** * @dataProvider spit */publicfunctiontestBar()
{
$this->assertEquals(1, 1);
}
publicfunctionspit()
{
returnarray();
}
}
When I execute all tests, BarTest::testBar gives a warning, because of an empty dataProvider:
$ phpunit .
PHPUnit 3.5.14 by Sebastian Bergmann.
F.
Time: 0 seconds, Memory: 3.75Mb
There was 1 failure:
1) Warning
No tests found in suite "BarTest::testBar".
FAILURES!
Tests: 2, Assertions: 1, Failures: 1.
When I just run a test on group bar the test is simply skipped without a warning. I would expect the same warning to be generated.
$ phpunit --group bar .
PHPUnit 3.5.14 by Sebastian Bergmann.
Time: 0 seconds, Memory: 3.50Mb
OK (0 tests, 0 assertions)
The text was updated successfully, but these errors were encountered:
This is no longer a bug. I think it was probably fixed by #781.
$ phpunit --group bar .
PHPUnit 3.7.18 by Sebastian Bergmann.
F
Time: 0 seconds, Memory: 2.50Mb
There was 1 failure:
1) Warning
No tests found in suite "BarTest::testBar".
FAILURES!
Tests: 1, Assertions: 0, Failures: 1.
A test with a dataProvider that returns an empty array normally generates a warning. But, when it is the only test, it does not generate a warning but is skipped instead. Example:
Or: https://gist.github.com/1089631
When I execute all tests,
BarTest::testBar
gives a warning, because of an empty dataProvider:When I just run a test on group
bar
the test is simply skipped without a warning. I would expect the same warning to be generated.The text was updated successfully, but these errors were encountered: