diff --git a/tests/DriverManagerTest.php b/tests/DriverManagerTest.php index d633edafe43..8e440a7a545 100644 --- a/tests/DriverManagerTest.php +++ b/tests/DriverManagerTest.php @@ -21,6 +21,7 @@ use function in_array; use function is_array; +/** @psalm-import-type Params from DriverManager */ class DriverManagerTest extends TestCase { use VerifyDeprecations; @@ -100,6 +101,7 @@ public function testDatabaseUrlPrimaryReplica(): void 'wrapperClass' => PrimaryReadReplicaConnection::class, ]; + $this->expectDeprecationWithIdentifier('https://github.com/doctrine/dbal/pull/5843'); $conn = DriverManager::getConnection($options); $params = $conn->getParams(); @@ -134,6 +136,7 @@ public function testDatabaseUrlPrimaryReplica(): void /** * @param array|false $expected + * @psalm-param Params|string $url * * @dataProvider databaseUrls */ @@ -161,14 +164,22 @@ public function testDatabaseUrlDeprecated(array|string $url, array|false $expect } /** - * @param array|false $expected + * @param array|string $url + * @param array|false $expected * * @dataProvider databaseUrls */ public function testDatabaseUrl(array|string $url, array|false $expected): void { if (is_array($url)) { + if (isset($url['driverClass'])) { + self::markTestSkipped( + 'Legacy test case: Merging driverClass into the parsed parameters has to be done in userland now.', + ); + } + ['url' => $url] = $options = $url; + unset($options['url']); } else { $options = []; } @@ -194,7 +205,11 @@ public function testDatabaseUrl(array|string $url, array|false $expected): void } } - /** @return array> */ + /** @psalm-return array, + * array|false, + * }> + */ public function databaseUrls(): iterable { $driver = $this->createMock(Driver::class);