liip / LiipTestFixturesBundle

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

[Bug]: Not configuring a schema manager factory is deprecated. Use %s which is going to be the default in DBAL 4. #318

Open KoNekoD opened 2 months ago

KoNekoD commented 2 months ago

Preconditions

  protected function createDatabaseIfNotExists(): void
    {
        $params = $this->connection->getParams();

        // doctrine-bundle >= 2.2
        if (isset($params['primary'])) {
            $params = $params['primary'];
        }
        // doctrine-bundle < 2.2
        elseif (isset($params['master'])) {
            $params = $params['master'];
        }
        $dbName = $params['dbname'] ?? '';

        unset($params['dbname'], $params['url']);

        // Unset url to avoid issue:
        // “An exception occurred in driver: SQLSTATE[HY000] [1049] Unknown database 'test'”

        $tmpConnection = DriverManager::getConnection($params, <- here needed to inject configuration with defined schema manager);

Steps to reproduce

Just start use library

Expected result

No deprecations

Actual result

Has deprecations

alexislefebvre commented 1 month ago

Thanks for the report, what is %s in this context? Do you have more information about this deprecation?