0
votes

Is it possible to use the newest version of PHPUnit (7.0.1) with Symfony 3.4? I receive the error

PHP Fatal error: Declaration of Symfony\Bridge\PhpUnit\CoverageListener::startTest(PHPUnit\Framework\Test $test) must be compatible with PHPUnit\Framework\TestListener::startTest(PHPUnit\Framework\Test $test): void in /var/www/vhosts/facto/vendor/symfony/phpunit-bridge/CoverageListener.php on line 30

My phpunit-bridge is not compatible with the newest version of PHPUnit.

1

1 Answers

3
votes

The codebase for symfony/phpunit-bridge for 3.4.4 and 4.0.4 are identical, Both of which extend PHPUnit\Framework\BaseTestListener, and was removed in PHPUnit 7.0. So the issue would persist in the 3.4 and 4.0 versions of Symfony.

In order to use PHPUnit 7.0 you would need to upgrade to Symfony 4.1. Which supports PHPUnit 5, 6, and 7. Where Symfony 3.4 and 4.0 support PHPUnit 6 when used with PHP 7.0+


UPDATE

symfony/phpunit-bridge 3.4.5 added support for PHPUnit 7, where symfony/phpunit-bridge 3.4.7 fixed an issue with autoloading.