Driver is class name in 10.2.x

Created on 9 November 2023, 11 months ago
Updated 28 February 2024, 7 months ago

Problem/Motivation

In 10.1.x my unit tests for entity_hierarchy work. In 10.2.x I get the following error.
This is because the database info for 'driver' as returned by Database::getAllConnectionInfo() is now a class name.

1) Drupal\Tests\entity_hierarchy\Functional\DeleteParentWarningTest::testDeleteWarning
Doctrine\DBAL\Exception: The given 'driver' pdo_Drupal\mysql\Driver\Database\mysql is unknown, Doctrine currently supports only the following drivers: pdo_mysql, pdo_sqlite, pdo_pgsql, pdo_oci, oci8, ibm_db2, pdo_sqlsrv, mysqli, drizzle_pdo_mysql, sqlanywhere, sqlsrv

/var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:138
/var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php:296
/var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php:250
/var/www/html/modules/contrib/dbal/src/ConnectionFactory.php:78
/var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php:255
/var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php:177
/var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php:440
/var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php:237
/var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php:177
/var/www/html/modules/contrib/entity_hierarchy/tests/src/Traits/EntityHierarchyTestTrait.php:55
/var/www/html/modules/contrib/entity_hierarchy/tests/src/Functional/DeleteParentWarningTest.php:43
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

Steps to reproduce

Get 10.2.x and use ConnectionFactory to get a database connection.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia nterbogt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024