Skip to content

Commit

Permalink
Fix tests for MySQL 8.4 (#2281)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajibarra committed May 24, 2024
1 parent 69eaf20 commit 12340e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2']
php-version: ['8.1', '8.2', '8.3']
db-type: [sqlite, mysql, pgsql]
prefer-lowest: ['']
include:
Expand All @@ -27,8 +27,12 @@ jobs:

steps:
- name: Setup MySQL latest
if: matrix.db-type == 'mysql' && matrix.php-version != '8.1'
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp -p 3306:3306 -d mysql:8.3
if: matrix.db-type == 'mysql' && matrix.php-version == '8.3'
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp -p 3306:3306 -d mysql:8.4

- name: Setup MySQL 8.0
if: matrix.db-type == 'mysql' && matrix.php-version == '8.2'
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp -p 3306:3306 -d mysql:8.0

- name: Setup MySQL 5.6
if: matrix.db-type == 'mysql' && matrix.php-version == '8.1'
Expand Down
4 changes: 2 additions & 2 deletions tests/Phinx/Db/Adapter/MysqlAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,7 @@ public function testDropForeignKeyByNonExistentKeyColumns(array $columns)
$refTable = new Table('ref_table', [], $this->adapter);
$refTable
->addColumn('field1', 'string', ['limit' => 8])
->addIndex(['id', 'field1'])
->addIndex(['id', 'field1'], ['unique' => true])
->save();

$table = new Table('table', [], $this->adapter);
Expand Down Expand Up @@ -1897,7 +1897,7 @@ public function testDropForeignKeyAsString()
public function testHasForeignKey($tableDef, $key, $exp)
{
$conn = $this->adapter->getConnection();
$conn->exec('CREATE TABLE other(a int, b int, c int, key(a), key(b), key(a,b), key(a,b,c));');
$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));');
$conn->exec($tableDef);
$this->assertSame($exp, $this->adapter->hasForeignKey('t', $key));
}
Expand Down

0 comments on commit 12340e9

Please sign in to comment.