test: Adjust the test for the warning of Oracle

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/56767/head
Joas Schilling 2025-12-01 15:26:37 +07:00
parent 76d35e49ed
commit baabe272f5
No known key found for this signature in database
GPG Key ID: F72FA5B49FFA96B0
1 changed files with 11 additions and 4 deletions

@ -41,11 +41,18 @@ class SupportedDatabaseTest extends TestCase {
}
public function testPass(): void {
$severities = [SetupResult::SUCCESS, SetupResult::INFO];
if ($this->connection->getDatabaseProvider() === IDBConnection::PLATFORM_SQLITE) {
/** SQlite always gets a warning */
$this->assertEquals(SetupResult::WARNING, $this->check->run()->getSeverity());
} else {
$this->assertContains($this->check->run()->getSeverity(), [SetupResult::SUCCESS, SetupResult::INFO]);
$severities = [SetupResult::WARNING];
} elseif ($this->connection->getDatabaseProvider(true) === IDBConnection::PLATFORM_ORACLE) {
$result = $this->connection->executeQuery('SELECT VERSION FROM PRODUCT_COMPONENT_VERSION');
$version = $result->fetchOne();
$result->closeCursor();
if (str_starts_with($version, '11.')) {
$severities = [SetupResult::WARNING];
}
}
$this->assertContains($this->check->run()->getSeverity(), $severities, 'Oracle 11 and SQLite expect a warning, other databases should be success or info only');
}
}