Skip to content

Commit

Permalink
More test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosp committed Dec 11, 2024
1 parent 57133d7 commit 8402885
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/TestCase/Db/Adapter/MysqlAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ private function usingMysql8(): bool
{
$version = $this->adapter->getConnection()->getDriver()->version();

return version_compare($version, '8.0.0', '>=');
return version_compare($version, '8.0.0', '>=')
&& version_compare($version, '10.0.0', '<');
}

private function usingMariaDbWithUuid(): bool
Expand Down Expand Up @@ -2495,7 +2496,7 @@ public function testDefaultsCastAsExpressionsForCertainTypes(string $type, strin
$this->adapter->connect();

$table = new Table('table1', ['id' => false], $this->adapter);
if (!$this->usingMysql8()) {
if (!$this->usingMysql8() && !$this->usingMariaDbWithUuid()) {
$this->expectException(PDOException::class);
}
$table
Expand All @@ -2505,7 +2506,12 @@ public function testDefaultsCastAsExpressionsForCertainTypes(string $type, strin
$columns = $this->adapter->getColumns('table1');
$this->assertCount(1, $columns);
$this->assertSame('col_1', $columns[0]->getName());
$this->assertSame($default, $columns[0]->getDefault());

if ($this->usingMariaDbWithUuid()) {
$this->assertSame("'{$default}'", $columns[0]->getDefault());
} else {
$this->assertSame($default, $columns[0]->getDefault());
}
}

public function testCreateTableWithPrecisionCurrentTimestamp()
Expand Down

0 comments on commit 8402885

Please sign in to comment.