Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PHPUnit 9 with empty data provider leads to SkippedTestError #565

Closed
bytestream opened this issue Nov 27, 2020 · 2 comments · Fixed by #567
Closed

PHPUnit 9 with empty data provider leads to SkippedTestError #565

bytestream opened this issue Nov 27, 2020 · 2 comments · Fixed by #567
Labels

Comments

@bytestream
Copy link

bytestream commented Nov 27, 2020

When using PHPUnit 9 with either paratest v5 or v6 and an empty data provider paratest outputs a fatal error:

$ vendor/bin/phpunit 
PHPUnit 9.4.3 by Sebastian Bergmann and contributors.

S                                                                   1 / 1 (100%)

Time: 00:00.006, Memory: 6.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 1, Assertions: 0, Skipped: 1.

$ vendor/bin/paratest 

In DocBlock.php line 291:
                                        
  [PHPUnit\Framework\SkippedTestError]  
                                        

paratest [--bootstrap BOOTSTRAP] [--colors] [-c|--configuration CONFIGURATION] [--coverage-clover COVERAGE-CLOVER] [--coverage-cobertura COVERAGE-COBERTURA] [--coverage-crap4j COVERAGE-CRAP4J] [--coverage-html COVERAGE-HTML] [--coverage-php COVERAGE-PHP] [--coverage-test-limit COVERAGE-TEST-LIMIT] [--coverage-text] [--coverage-xml COVERAGE-XML] [--exclude-group EXCLUDE-GROUP] [--filter FILTER] [-f|--functional] [-g|--group GROUP] [-h|--help] [--log-junit LOG-JUNIT] [--log-teamcity LOG-TEAMCITY] [-m|--max-batch-size MAX-BATCH-SIZE] [--no-test-tokens] [--order-by [ORDER-BY]] [--parallel-suite] [--passthru PASSTHRU] [--passthru-php PASSTHRU-PHP] [--path PATH] [-p|--processes PROCESSES] [--random-order-seed [RANDOM-ORDER-SEED]] [--runner RUNNER] [--stop-on-failure] [--testsuite TESTSUITE] [--tmp-dir TMP-DIR] [-v|--verbose VERBOSE] [--whitelist WHITELIST] [--] [<path>]

Full stack trace:

#0 /php-unit-bug/vendor/phpunit/phpunit/src/Util/Test.php(319): PHPUnit\Util\Annotation\DocBlock->getProvidedData()
#1 /php-unit-bug/vendor/brianium/paratest/src/Runners/PHPUnit/SuiteLoader.php(312): PHPUnit\Util\Test::getProvidedData()
#2 /php-unit-bug/vendor/brianium/paratest/src/Runners/PHPUnit/SuiteLoader.php(235): ParaTest\Runners\PHPUnit\SuiteLoader->getMethodTests()
#3 /php-unit-bug/vendor/brianium/paratest/src/Runners/PHPUnit/SuiteLoader.php(206): ParaTest\Runners\PHPUnit\SuiteLoader->getMethodBatches()
#4 /php-unit-bug/vendor/brianium/paratest/src/Runners/PHPUnit/SuiteLoader.php(373): ParaTest\Runners\PHPUnit\SuiteLoader->executableTests()
#5 /php-unit-bug/vendor/brianium/paratest/src/Runners/PHPUnit/SuiteLoader.php(189): ParaTest\Runners\PHPUnit\SuiteLoader->createSuite()
#6 /php-unit-bug/vendor/brianium/paratest/src/Runners/PHPUnit/SuiteLoader.php(171): ParaTest\Runners\PHPUnit\SuiteLoader->initSuites()
#7 /php-unit-bug/vendor/brianium/paratest/src/Runners/PHPUnit/BaseRunner.php(93): ParaTest\Runners\PHPUnit\SuiteLoader->load()
#8 /php-unit-bug/vendor/brianium/paratest/src/Runners/PHPUnit/BaseRunner.php(74): ParaTest\Runners\PHPUnit\BaseRunner->load()
#9 /php-unit-bug/vendor/brianium/paratest/src/Console/Commands/ParaTestCommand.php(86): ParaTest\Runners\PHPUnit\BaseRunner->run()
#10 /php-unit-bug/vendor/symfony/console/Command/Command.php(258): ParaTest\Console\Commands\ParaTestCommand->execute()
#11 /php-unit-bug/vendor/symfony/console/Application.php(921): Symfony\Component\Console\Command\Command->run()
#12 /php-unit-bug/vendor/symfony/console/Application.php(267): Symfony\Component\Console\Application->doRunCommand()
#13 /php-unit-bug/vendor/symfony/console/Application.php(143): Symfony\Component\Console\Application->doRun()
#14 /php-unit-bug/vendor/brianium/paratest/bin/paratest(37): Symfony\Component\Console\Application->run()

Steps to replicate: https://github.com/bytestream/phpunit-4493

The issue was introduced by changes in 5.0.0 by #497

Suggested fix:

@Slamdunk Slamdunk added the bug label Nov 27, 2020
@Slamdunk
Copy link
Member

@bytestream
Copy link
Author

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants