mikeerickson / phpunit-pretty-result-printer

PHPUnit Pretty Result Printer -- make your PHPUnit tests look pretty!
MIT License
1.2k stars 71 forks source link

ResultPrinter71::printDefects does no match PHPUnit\TextUI\ResultPrinter::printDefects (7.4.3) #132

Closed AdrianHL closed 6 years ago

AdrianHL commented 6 years ago

Got the following error when running phpunit tests with PHPUnit 7.4.3.

+ phpunit PHP Warning: Declaration of Codedungeon\PHPUnitPrettyResultPrinter\ResultPrinter71::printDefects(array $defects, string $type): void should be compatible with PHPUnit\TextUI\ResultPrinter::printDefects(array $defects, $type) in /opt/atlassian/pipelines/agent/build/vendor/codedungeon/phpunit-result-printer/src/ResultPrinter71.php on line 17 PHP Stack trace: PHP 1. {main}() /tmp/vendor/phpunit/phpunit/phpunit:0 PHP 2. PHPUnit\TextUI\Command::main() /tmp/vendor/phpunit/phpunit/phpunit:53 PHP 3. PHPUnit\TextUI\Command->run() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:148 PHP 4. PHPUnit\TextUI\Command->handleArguments() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:159 PHP 5. PHPUnit\TextUI\Command->handlePrinter() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:815 PHP 6. class_exists() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:934 PHP 7. spl_autoload_call() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:934 PHP 8. Composer\Autoload\ClassLoader->loadClass() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:934 PHP 9. Composer\Autoload\includeFile() /tmp/vendor/composer/ClassLoader.php:322 PHP 10. include() /tmp/vendor/composer/ClassLoader.php:444 PHP 11. spl_autoload_call() /opt/atlassian/pipelines/agent/build/vendor/codedungeon/phpunit-result-printer/src/Printer.php:36 PHP 12. Composer\Autoload\ClassLoader->loadClass() /opt/atlassian/pipelines/agent/build/vendor/codedungeon/phpunit-result-printer/src/Printer.php:36 PHP 13. Composer\Autoload\includeFile() /tmp/vendor/composer/ClassLoader.php:322 PHP 14. include() /tmp/vendor/composer/ClassLoader.php:444 PHP Warning: Declaration of Codedungeon\PHPUnitPrettyResultPrinter\ResultPrinter71::writeProgress(string $progress): void should be compatible with PHPUnit\TextUI\ResultPrinter::writeProgress($progress) in /opt/atlassian/pipelines/agent/build/vendor/codedungeon/phpunit-result-printer/src/ResultPrinter71.php on line 17 PHP Stack trace: PHP 1. {main}() /tmp/vendor/phpunit/phpunit/phpunit:0 PHP 2. PHPUnit\TextUI\Command::main() /tmp/vendor/phpunit/phpunit/phpunit:53 PHP 3. PHPUnit\TextUI\Command->run() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:148 PHP 4. PHPUnit\TextUI\Command->handleArguments() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:159 PHP 5. PHPUnit\TextUI\Command->handlePrinter() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:815 PHP 6. class_exists() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:934 PHP 7. spl_autoload_call() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:934 PHP 8. Composer\Autoload\ClassLoader->loadClass() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:934 PHP 9. Composer\Autoload\includeFile() /tmp/vendor/composer/ClassLoader.php:322 PHP 10. include() /tmp/vendor/composer/ClassLoader.php:444 PHP 11. spl_autoload_call() /opt/atlassian/pipelines/agent/build/vendor/codedungeon/phpunit-result-printer/src/Printer.php:36 PHP 12. Composer\Autoload\ClassLoader->loadClass() /opt/atlassian/pipelines/agent/build/vendor/codedungeon/phpunit-result-printer/src/Printer.php:36 PHP 13. Composer\Autoload\includeFile() /tmp/vendor/composer/ClassLoader.php:322 PHP 14. include() /tmp/vendor/composer/ClassLoader.php:444 PHP Warning: Declaration of Codedungeon\PHPUnitPrettyResultPrinter\ResultPrinter71::writeProgressWithColor(string $progress, string $buffer): void should be compatible with PHPUnit\TextUI\ResultPrinter::writeProgressWithColor($color, $buffer) in /opt/atlassian/pipelines/agent/build/vendor/codedungeon/phpunit-result-printer/src/ResultPrinter71.php on line 17 PHP Stack trace: PHP 1. {main}() /tmp/vendor/phpunit/phpunit/phpunit:0 PHP 2. PHPUnit\TextUI\Command::main() /tmp/vendor/phpunit/phpunit/phpunit:53 PHP 3. PHPUnit\TextUI\Command->run() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:148 PHP 4. PHPUnit\TextUI\Command->handleArguments() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:159 PHP 5. PHPUnit\TextUI\Command->handlePrinter() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:815 PHP 6. class_exists() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:934 PHP 7. spl_autoload_call() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:934 PHP 8. Composer\Autoload\ClassLoader->loadClass() /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:934 PHP 9. Composer\Autoload\includeFile() /tmp/vendor/composer/ClassLoader.php:322 PHP 10. include() /tmp/vendor/composer/ClassLoader.php:444 PHP 11. spl_autoload_call() /opt/atlassian/pipelines/agent/build/vendor/codedungeon/phpunit-result-printer/src/Printer.php:36

The PHPUnit file was changed in https://github.com/sebastianbergmann/phpunit/commit/678c0965c2eb61b62d90d59496dd5a6842bb8848 so maybe a new ResultPrinter is needed.

mikeerickson commented 6 years ago

Yes it sure does look that way. I will have a look and get an update posted

AdrianHL commented 6 years ago

Fixed now. The container image was using PHPUnit 6.5.3. We changed from https://hub.docker.com/r/phpunit/phpunit to https://hub.docker.com/r/epcallan/php7-testing-phpunit, plus some tweaks to the container setup have fixed the issue.

mikeerickson commented 6 years ago

@AdrianHL Thanks for the confirmation. I just tested the latest PHPUnit against this project and everything is working without any modifications so I was about to ask for more details 😀