Skip to content

Commit

Permalink
Configure default collation for test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mneudert committed Sep 12, 2024
1 parent d36002d commit 8bb611f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions config/global.ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
type = InnoDB
schema = Mysql
charset = utf8mb4
collation = utf8mb4_general_ci
enable_ssl = 0
ssl_ca =
ssl_cert =
Expand Down
14 changes: 7 additions & 7 deletions tests/PHPUnit/Integration/Db/Schema/MariadbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ public function testTableCreateOptions(array $optionOverrides, string $expected)

public function getTableCreateOptionsTestData(): iterable
{
yield 'defaults' => [
[],
yield 'default charset, empty collation' => [
['collation' => ''],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC'
];

yield 'override charset' => [
['charset' => 'utf8mb3'],
yield 'override charset, empty collation' => [
['charset' => 'utf8mb3', 'collation' => ''],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb3'
];

yield 'override collation' => [
['collation' => 'utf8mb4_general_ci'],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC'
yield 'default charset, override collation' => [
['collation' => 'utf8mb4_swedish_ci'],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_swedish_ci ROW_FORMAT=DYNAMIC'
];

yield 'override charset and collation' => [
Expand Down
14 changes: 7 additions & 7 deletions tests/PHPUnit/Integration/Db/Schema/MysqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ public function testTableCreateOptions(array $optionOverrides, string $expected)

public function getTableCreateOptionsTestData(): iterable
{
yield 'defaults' => [
[],
yield 'default charset, empty collation' => [
['collation' => ''],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC'
];

yield 'override charset' => [
['charset' => 'utf8mb3'],
yield 'override charset, empty collation' => [
['charset' => 'utf8mb3', 'collation' => ''],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb3'
];

yield 'override collation' => [
['collation' => 'utf8mb4_general_ci'],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC'
yield 'default charset, override collation' => [
['collation' => 'utf8mb4_swedish_ci'],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_swedish_ci ROW_FORMAT=DYNAMIC'
];

yield 'override charset and collation' => [
Expand Down
16 changes: 8 additions & 8 deletions tests/PHPUnit/Integration/Db/Schema/TidbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ public function testTableCreateOptions(array $optionOverrides, string $expected)

public function getTableCreateOptionsTestData(): iterable
{
yield 'defaults' => [
[],
yield 'default charset, empty collation' => [
['collation' => ''],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC'
];

yield 'override charset' => [
['charset' => 'utf8mb3'],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb4_0900_ai_ci'
yield 'override charset, empty collation' => [
['charset' => 'utf8mb3', 'collation' => ''],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb3'
];

yield 'override collation' => [
['collation' => 'utf8mb4_general_ci'],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC'
yield 'default charset, override collation' => [
['collation' => 'utf8mb4_swedish_ci'],
'ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_swedish_ci ROW_FORMAT=DYNAMIC'
];

yield 'override charset and collation' => [
Expand Down

0 comments on commit 8bb611f

Please sign in to comment.