Skip to content

Commit baabe27

Browse files
committed
test: Adjust the test for the warning of Oracle
Signed-off-by: Joas Schilling <[email protected]>
1 parent 76d35e4 commit baabe27

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

apps/settings/tests/SetupChecks/SupportedDatabaseTest.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,18 @@ protected function setUp(): void {
4141
}
4242

4343
public function testPass(): void {
44+
$severities = [SetupResult::SUCCESS, SetupResult::INFO];
4445
if ($this->connection->getDatabaseProvider() === IDBConnection::PLATFORM_SQLITE) {
45-
/** SQlite always gets a warning */
46-
$this->assertEquals(SetupResult::WARNING, $this->check->run()->getSeverity());
47-
} else {
48-
$this->assertContains($this->check->run()->getSeverity(), [SetupResult::SUCCESS, SetupResult::INFO]);
46+
$severities = [SetupResult::WARNING];
47+
} elseif ($this->connection->getDatabaseProvider(true) === IDBConnection::PLATFORM_ORACLE) {
48+
$result = $this->connection->executeQuery('SELECT VERSION FROM PRODUCT_COMPONENT_VERSION');
49+
$version = $result->fetchOne();
50+
$result->closeCursor();
51+
if (str_starts_with($version, '11.')) {
52+
$severities = [SetupResult::WARNING];
53+
}
4954
}
55+
56+
$this->assertContains($this->check->run()->getSeverity(), $severities, 'Oracle 11 and SQLite expect a warning, other databases should be success or info only');
5057
}
5158
}

0 commit comments

Comments
 (0)