liip / LiipTestFixturesBundle

This bundles enables efficient loading of Doctrine fixtures in functional test-cases for Symfony applications
https://liip.ch
MIT License
167 stars 45 forks source link

[Feature Request]: Upgrading doctrine/dbal Connection handling #259

Open sven-ahrens opened 8 months ago

sven-ahrens commented 8 months ago

Is your feature request related to a problem? Please describe.

When I use this package and run my tests, I'm getting mutliple deprecation messages by the package: doctrine/dbal

34x: Subscribing to onSchemaCreateTable events is deprecated. (AbstractPlatform.php:2145 called by AbstractPlatform.php:2064, https://github.com/doctrine/dbal/issues/5784, package doctrine/dbal)

1x: Not configuring a schema manager factory is deprecated. Use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory which is going to be the default in DBAL 4. (Connection.php:221 called by DriverManager.php:197, https://github.com/doctrine/dbal/issues/5812, package doctrine/dbal)

1x: Public access to Connection::connect() is deprecated. (Connection.php:366 called by ORMDatabaseTool.php:180, https://github.com/doctrine/dbal/issues/4966, package doctrine/dbal)

1x: Connection::getSchemaManager() is deprecated, use Connection::createSchemaManager() instead. (Connection.php:1697 called by ORMDatabaseTool.php:182, https://github.com/doctrine/dbal/issues/4515, package doctrine/dbal)

This only ocurrs when I use stuff made by this package like:

$databaseTool = static::getContainer()->get(DatabaseToolCollection::class)->get();

        $databaseTool->loadAliceFixture(

Describe alternatives you've considered

-

Additional context

Hope this helps as additional context.

The test itself did nothing in this case. I purged everything and just run the code like I mentioned above and then got those deprecation messages.

alexislefebvre commented 8 months ago

Thanks for the report.

Would you be able to open a PR?

sven-ahrens commented 8 months ago

Thanks for the report.

Would you be able to open a PR?

I'm new to Symfony and this package, but I'm willing to give it a shot this weekend. :)

Chris53897 commented 7 months ago

My solution in another PR is like this. But of course a PR should support multiple versions of doctrine/dbal

https://github.com/liip/LiipTestFixturesBundle/blob/b75c2714d1c8f5caa1f62814be6d83240c6cd4ff/src/Services/DatabaseTools/ORMDatabaseTool.php#L183

Chris53897 commented 7 months ago

@sven-ahrens Can this be closed as implemented? https://github.com/liip/LiipTestFixturesBundle/releases/tag/2.7.3

PromedPromed commented 5 months ago

Still an issue with liip/test-fixtures-bundle 2.9.0.