dmaicher / doctrine-test-bundle

Symfony bundle to isolate your app's doctrine database tests and improve the test performance
MIT License
1.08k stars 61 forks source link

Fatal error: Declaration of DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener #112

Closed engharb closed 4 years ago

engharb commented 4 years ago

By installing the bundle I got the following error:

Fatal error: Declaration of DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener::endTest(PHPUnit\Framework\Test $test, float $time): void must be compatible with PHPUnit\Framework\TestListener::endTest(PHPUnit\Framework\Test $test, $time) in /var/www/html/vendor/dama/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/PHPUnit/PHPUnitListener.php on line 7

Local configuration: Symfony 4.4.4 phpunit/phpunit (6.5.14) symfony/phpunit-bridge (v4.4.4) version ^6.3 for dama/doctrine-test-bundle

OS: Linux

Any idea?

Thank you

dmaicher commented 4 years ago

As described in the readme the current version of the bundle is incompatible with PHPUnit 6 (which is not maintained anymore).

You need at least PHPUnit 7.

With the phpunit bridge you can achieve this like done on the symfony demo:

https://github.com/symfony/demo/blob/master/phpunit.xml.dist#L15

But even PHPUnit 7 is not maintained anymore :wink: So probably better to directly move to version 8 (and use the extension shipped with this bundle and not the listener; see readme).