From 829f2b9bc7290c0b1b1a9db373ee26199c9bcc4d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 1 Jul 2024 16:59:47 +0200 Subject: fix(db): Promote the use of `getDatabaseProvider` to reduce the impage of removed upstream platforms Signed-off-by: Joas Schilling --- tests/lib/DB/MigrationsTest.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tests/lib/DB/MigrationsTest.php') diff --git a/tests/lib/DB/MigrationsTest.php b/tests/lib/DB/MigrationsTest.php index 6cd489258bf..2bdd705ff5d 100644 --- a/tests/lib/DB/MigrationsTest.php +++ b/tests/lib/DB/MigrationsTest.php @@ -8,8 +8,6 @@ namespace Test\DB; -use Doctrine\DBAL\Platforms\OraclePlatform; -use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\Index; @@ -326,9 +324,9 @@ class MigrationsTest extends \Test\TestCase { public function testEnsureOracleConstraintsValidWithPrimaryKeyDefault() { $defaultName = 'PRIMARY'; - if ($this->db->getDatabasePlatform() instanceof PostgreSqlPlatform) { + if ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_POSTGRES) { $defaultName = \str_repeat('a', 26) . '_' . \str_repeat('b', 30) . '_seq'; - } elseif ($this->db->getDatabasePlatform() instanceof OraclePlatform) { + } elseif ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_ORACLE) { $defaultName = \str_repeat('a', 26) . '_seq'; } @@ -407,9 +405,9 @@ class MigrationsTest extends \Test\TestCase { $this->expectException(\InvalidArgumentException::class); $defaultName = 'PRIMARY'; - if ($this->db->getDatabasePlatform() instanceof PostgreSqlPlatform) { + if ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_POSTGRES) { $defaultName = \str_repeat('a', 27) . '_' . \str_repeat('b', 30) . '_seq'; - } elseif ($this->db->getDatabasePlatform() instanceof OraclePlatform) { + } elseif ($this->db->getDatabaseProvider() === IDBConnection::PLATFORM_ORACLE) { $defaultName = \str_repeat('a', 27) . '_seq'; } -- cgit v1.2.3