Skip to content

Commit 12340e9

Browse files
authored
Fix tests for MySQL 8.4 (#2281)
1 parent 69eaf20 commit 12340e9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php-version: ['8.1', '8.2']
17+
php-version: ['8.1', '8.2', '8.3']
1818
db-type: [sqlite, mysql, pgsql]
1919
prefer-lowest: ['']
2020
include:
@@ -27,8 +27,12 @@ jobs:
2727

2828
steps:
2929
- name: Setup MySQL latest
30-
if: matrix.db-type == 'mysql' && matrix.php-version != '8.1'
31-
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp -p 3306:3306 -d mysql:8.3
30+
if: matrix.db-type == 'mysql' && matrix.php-version == '8.3'
31+
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp -p 3306:3306 -d mysql:8.4
32+
33+
- name: Setup MySQL 8.0
34+
if: matrix.db-type == 'mysql' && matrix.php-version == '8.2'
35+
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp -p 3306:3306 -d mysql:8.0
3236

3337
- name: Setup MySQL 5.6
3438
if: matrix.db-type == 'mysql' && matrix.php-version == '8.1'

tests/Phinx/Db/Adapter/MysqlAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,7 @@ public function testDropForeignKeyByNonExistentKeyColumns(array $columns)
18081808
$refTable = new Table('ref_table', [], $this->adapter);
18091809
$refTable
18101810
->addColumn('field1', 'string', ['limit' => 8])
1811-
->addIndex(['id', 'field1'])
1811+
->addIndex(['id', 'field1'], ['unique' => true])
18121812
->save();
18131813

18141814
$table = new Table('table', [], $this->adapter);
@@ -1897,7 +1897,7 @@ public function testDropForeignKeyAsString()
18971897
public function testHasForeignKey($tableDef, $key, $exp)
18981898
{
18991899
$conn = $this->adapter->getConnection();
1900-
$conn->exec('CREATE TABLE other(a int, b int, c int, key(a), key(b), key(a,b), key(a,b,c));');
1900+
$conn->exec('CREATE TABLE other(a int, b int, c int, unique key(a), unique key(b), unique key(a,b), unique key(a,b,c));');
19011901
$conn->exec($tableDef);
19021902
$this->assertSame($exp, $this->adapter->hasForeignKey('t', $key));
19031903
}

0 commit comments

Comments
 (0)