aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/DB/MigrationsTest.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-07-01 16:59:47 +0200
committerJoas Schilling <coding@schilljs.com>2024-07-19 11:21:14 +0200
commit829f2b9bc7290c0b1b1a9db373ee26199c9bcc4d (patch)
tree5641e35ffe42897566f58acb1d71a0d9afba4729 /tests/lib/DB/MigrationsTest.php
parentbd383627a7ef3cb0a8e608b35de067d341f46da4 (diff)
downloadnextcloud-server-829f2b9bc7290c0b1b1a9db373ee26199c9bcc4d.tar.gz
nextcloud-server-829f2b9bc7290c0b1b1a9db373ee26199c9bcc4d.zip
fix(db): Promote the use of `getDatabaseProvider` to reduce the impage of removed upstream platforms
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/DB/MigrationsTest.php')
-rw-r--r--tests/lib/DB/MigrationsTest.php10
1 files changed, 4 insertions, 6 deletions
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';
}