Closed sidz closed 3 years ago
This breaks when using doctrine/dbal
2.12.0
:
vendor/bin/phpunit -c tests/ tests/
PHP Fatal error: Declaration of DAMA\DoctrineTestBundle\Doctrine\DBAL\AbstractStaticDriverV3::connect(array $params) must be compatible with Doctrine\DBAL\Driver::connect(array $params, $username = NULL, $password = NULL, array $driverOptions = Array) in /var/www/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/Doctrine/DBAL/AbstractStaticDriverV3.php on line 17
Fatal error: Declaration of DAMA\DoctrineTestBundle\Doctrine\DBAL\AbstractStaticDriverV3::connect(array $params) must be compatible with Doctrine\DBAL\Driver::connect(array $params, $username = NULL, $password = NULL, array $driverOptions = Array) in /var/www/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/Doctrine/DBAL/AbstractStaticDriverV3.php on line 17
In AbstractStaticDriverV3.php line 17:
[Symfony\Component\ErrorHandler\Error\FatalError]
Compile Error: Declaration of DAMA\DoctrineTestBundle\Doctrine\DBAL\AbstractStaticDriverV3::connect(array $params) must be compatible with Doctrine\DBAL\Driver::connect(array $params, $username = NULL, $pas
sword = NULL, array $driverOptions = Array)
Exception trace:
at /var/www/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/Doctrine/DBAL/AbstractStaticDriverV3.php:17
doctrine:database:drop [-s|--shard SHARD] [-c|--connection [CONNECTION]] [--if-exists] [-f|--force]
I also fail to see what exactly this fixes? on dbal < 3 we need to use the class extending ExceptionConverterDriver
as otherwise it simply does not work correctly. So we need to load the deprecated interface anyway?
wondered why CI not fail :)
I also fail to see what exactly this fixes? on dbal < 3 we need to use the class extending ExceptionConverterDriver as otherwise it simply does not work correctly.
Probably I missed smth. I'll take a look more attentively and back with solution.
Looks like I was too optimistic :)
I'm going to close this PR.
This PR:
doctrine/dbal
version check to avoid using deprecatedExceptionConverterDriver
start from dbal 2.11.0.This fix works for the lowest supported version (2.9.3) as well.
related issue: https://github.com/dmaicher/doctrine-test-bundle/issues/129