dmaicher / doctrine-test-bundle

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

Depreciation to fix #188

Closed bastien70 closed 2 years ago

bastien70 commented 2 years ago

Hello, when launching my tests from Symfony 5.4 (PHP 8.0) app, I've a depreciation :

The "DAMA\DoctrineTestBundle\Doctrine\DBAL\AbstractStaticDriver" class implements "Doctrine\DBAL\VersionAwarePlatformDriver" that is deprecated All drivers will have to be aware of the server version in the next major release.
dmaicher commented 2 years ago

Yes I also noticed this deprecation on one of my projects. Unfortunately I don't think there is a way to fix this deprecation.

@morozov maybe you have an idea? I saw you deprecated that interface here.

morozov commented 2 years ago

@dmaicher what exactly is the problem?

dmaicher commented 2 years ago

@morozov this bundle comes with a driver that currently implements Doctrine\DBAL\VersionAwarePlatformDriver. Now that this interface is deprecated: Is there a way to stop implementing this interface and get rid of the reported deprecation? I guess not.

morozov commented 2 years ago

Right, you have to implement this interface.

bastien70 commented 2 years ago

Does it mean that it will be impossible to update this bundle for Symfony 6 ?

dmaicher commented 2 years ago

Does it mean that it will be impossible to update this bundle for Symfony 6 ?

No. The deprecation is coming from doctrine/dbal. This bundle is compatible with Symfony 6.

dmaicher commented 2 years ago

Closing as there is nothing we can do here to get rid of the deprecation.

maks-rafalko commented 2 years ago

Did anyone find a solution on how to silence this error? (Symfony 6, PHP 8.1)

Or is there "official" recommendation on how to avoid it?

pjehan commented 2 years ago

Did anyone find a solution on how to silence this error? (Symfony 6, PHP 8.1)

Or is there "official" recommendation on how to avoid it?

From this StackOverflow thread: https://stackoverflow.com/questions/35897550/remove-remaining-deprecation-notices-in-symfony-2-8

you can add this lines to the phpunit.xml file:

<php>
    <env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
</php>
maks-rafalko commented 2 years ago

you can add this lines to the phpunit.xml file:

yes, it works for PHPUnit execution.

However, the same deprecation message is displayed for example when you run:

bin/console doctrine:database:create --env=test
wassimbkd commented 1 year ago

upgrading to *"dama/doctrine-test-bundle": "v7.2."** fixed

fmonts commented 1 year ago

upgrading to *"dama/doctrine-test-bundle": "v7.2."** fixed

Unfortunately it doesn't, 7.2.1 still implements VersionAwarePlatformDriver: https://github.com/dmaicher/doctrine-test-bundle/blob/v7.2.1/src/DAMA/DoctrineTestBundle/Doctrine/DBAL/VersionAwarePlatformStaticDriver.php#L11C67-L11C104

It was fixed in https://github.com/dmaicher/doctrine-test-bundle/commit/629d385a71518c3efa1f86d9c7e62005191eddbd which will be part of 8.0