Skip to content

Commit 7f4d0a9

Browse files
committed
test: update charset utf8 to utf8mb4
1 parent 995da81 commit 7f4d0a9

4 files changed

Lines changed: 26 additions & 26 deletions

File tree

‎tests/_support/Config/Registrar.php‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Registrar
3434
'DBPrefix' => 'db_',
3535
'pConnect' => false,
3636
'DBDebug' => true,
37-
'charset' => 'utf8',
38-
'DBCollat' => 'utf8_general_ci',
37+
'charset' => 'utf8mb4',
38+
'DBCollat' => 'utf8mb4_general_ci',
3939
'swapPre' => '',
4040
'encrypt' => false,
4141
'compress' => false,
@@ -54,7 +54,7 @@ class Registrar
5454
'pConnect' => false,
5555
'DBDebug' => true,
5656
'charset' => 'utf8',
57-
'DBCollat' => 'utf8_general_ci',
57+
'DBCollat' => '',
5858
'swapPre' => '',
5959
'encrypt' => false,
6060
'compress' => false,
@@ -73,7 +73,7 @@ class Registrar
7373
'pConnect' => false,
7474
'DBDebug' => true,
7575
'charset' => 'utf8',
76-
'DBCollat' => 'utf8_general_ci',
76+
'DBCollat' => '',
7777
'swapPre' => '',
7878
'encrypt' => false,
7979
'compress' => false,
@@ -93,7 +93,7 @@ class Registrar
9393
'pConnect' => false,
9494
'DBDebug' => true,
9595
'charset' => 'utf8',
96-
'DBCollat' => 'utf8_general_ci',
96+
'DBCollat' => '',
9797
'swapPre' => '',
9898
'encrypt' => false,
9999
'compress' => false,
@@ -112,7 +112,7 @@ class Registrar
112112
'pConnect' => false,
113113
'DBDebug' => true,
114114
'charset' => 'AL32UTF8',
115-
'DBCollat' => 'utf8_general_ci',
115+
'DBCollat' => '',
116116
'swapPre' => '',
117117
'encrypt' => false,
118118
'compress' => false,

‎tests/system/Database/BaseConnectionTest.php‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ final class BaseConnectionTest extends CIUnitTestCase
3333
'DBPrefix' => 'test_',
3434
'pConnect' => true,
3535
'DBDebug' => (ENVIRONMENT !== 'production'),
36-
'charset' => 'utf8',
37-
'DBCollat' => 'utf8_general_ci',
36+
'charset' => 'utf8mb4',
37+
'DBCollat' => 'utf8mb4_general_ci',
3838
'swapPre' => '',
3939
'encrypt' => false,
4040
'compress' => false,
@@ -51,8 +51,8 @@ final class BaseConnectionTest extends CIUnitTestCase
5151
'DBPrefix' => 'test_',
5252
'pConnect' => true,
5353
'DBDebug' => (ENVIRONMENT !== 'production'),
54-
'charset' => 'utf8',
55-
'DBCollat' => 'utf8_general_ci',
54+
'charset' => 'utf8mb4',
55+
'DBCollat' => 'utf8mb4_general_ci',
5656
'swapPre' => '',
5757
'encrypt' => false,
5858
'compress' => false,
@@ -71,8 +71,8 @@ public function testSavesConfigOptions(): void
7171
$this->assertSame('MockDriver', $db->DBDriver);
7272
$this->assertTrue($db->pConnect);
7373
$this->assertTrue($db->DBDebug);
74-
$this->assertSame('utf8', $db->charset);
75-
$this->assertSame('utf8_general_ci', $db->DBCollat);
74+
$this->assertSame('utf8mb4', $db->charset);
75+
$this->assertSame('utf8mb4_general_ci', $db->DBCollat);
7676
$this->assertSame('', $db->swapPre);
7777
$this->assertFalse($db->encrypt);
7878
$this->assertFalse($db->compress);
@@ -153,7 +153,7 @@ public function testMagicGet(): void
153153
{
154154
$db = new MockConnection($this->options);
155155

156-
$this->assertSame('utf8', $db->charset);
156+
$this->assertSame('utf8mb4', $db->charset);
157157
}
158158

159159
public function testMagicGetMissing(): void

‎tests/system/Database/ConfigTest.php‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ final class ConfigTest extends CIUnitTestCase
3333
'DBPrefix' => 'test_',
3434
'pConnect' => true,
3535
'DBDebug' => (ENVIRONMENT !== 'production'),
36-
'charset' => 'utf8',
37-
'DBCollat' => 'utf8_general_ci',
36+
'charset' => 'utf8mb4',
37+
'DBCollat' => 'utf8mb4_general_ci',
3838
'swapPre' => '',
3939
'encrypt' => false,
4040
'compress' => false,
@@ -52,8 +52,8 @@ final class ConfigTest extends CIUnitTestCase
5252
'DBPrefix' => 't_',
5353
'pConnect' => false,
5454
'DBDebug' => (ENVIRONMENT !== 'production'),
55-
'charset' => 'utf8',
56-
'DBCollat' => 'utf8_general_ci',
55+
'charset' => 'utf8mb4',
56+
'DBCollat' => 'utf8mb4_general_ci',
5757
'swapPre' => '',
5858
'encrypt' => false,
5959
'compress' => false,
@@ -71,8 +71,8 @@ final class ConfigTest extends CIUnitTestCase
7171
'DBPrefix' => 't_',
7272
'pConnect' => false,
7373
'DBDebug' => (ENVIRONMENT !== 'production'),
74-
'charset' => 'utf8',
75-
'DBCollat' => 'utf8_general_ci',
74+
'charset' => 'utf8mb4',
75+
'DBCollat' => 'utf8mb4_general_ci',
7676
'swapPre' => '',
7777
'encrypt' => false,
7878
'compress' => false,
@@ -90,8 +90,8 @@ final class ConfigTest extends CIUnitTestCase
9090
'DBPrefix' => 't_',
9191
'pConnect' => false,
9292
'DBDebug' => (ENVIRONMENT !== 'production'),
93-
'charset' => 'utf8',
94-
'DBCollat' => 'utf8_general_ci',
93+
'charset' => 'utf8mb4',
94+
'DBCollat' => 'utf8mb4_general_ci',
9595
'swapPre' => '',
9696
'encrypt' => false,
9797
'compress' => false,
@@ -157,8 +157,8 @@ public function testConnectionGroupWithDSNPostgre(): void
157157
$this->assertSame('Postgre', $this->getPrivateProperty($conn, 'DBDriver'));
158158
$this->assertSame('test_', $this->getPrivateProperty($conn, 'DBPrefix'));
159159
$this->assertFalse($this->getPrivateProperty($conn, 'pConnect'));
160-
$this->assertSame('utf8', $this->getPrivateProperty($conn, 'charset'));
161-
$this->assertSame('utf8_general_ci', $this->getPrivateProperty($conn, 'DBCollat'));
160+
$this->assertSame('utf8mb4', $this->getPrivateProperty($conn, 'charset'));
161+
$this->assertSame('utf8mb4_general_ci', $this->getPrivateProperty($conn, 'DBCollat'));
162162
$this->assertTrue($this->getPrivateProperty($conn, 'strictOn'));
163163
$this->assertSame([], $this->getPrivateProperty($conn, 'failover'));
164164
$this->assertSame('5', $this->getPrivateProperty($conn, 'connect_timeout'));
@@ -185,8 +185,8 @@ public function testConnectionGroupWithDSNPostgreNative(): void
185185
$this->assertSame('Postgre', $this->getPrivateProperty($conn, 'DBDriver'));
186186
$this->assertSame('t_', $this->getPrivateProperty($conn, 'DBPrefix'));
187187
$this->assertFalse($this->getPrivateProperty($conn, 'pConnect'));
188-
$this->assertSame('utf8', $this->getPrivateProperty($conn, 'charset'));
189-
$this->assertSame('utf8_general_ci', $this->getPrivateProperty($conn, 'DBCollat'));
188+
$this->assertSame('utf8mb4', $this->getPrivateProperty($conn, 'charset'));
189+
$this->assertSame('utf8mb4_general_ci', $this->getPrivateProperty($conn, 'DBCollat'));
190190
$this->assertTrue($this->getPrivateProperty($conn, 'strictOn'));
191191
$this->assertSame([], $this->getPrivateProperty($conn, 'failover'));
192192
}

‎tests/system/Models/GeneralModelTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function testMagicGetters(): void
7575

7676
// from DB
7777
$this->assertTrue(isset($this->model->DBPrefix));
78-
$this->assertSame('utf8', $this->model->charset);
78+
$this->assertSame('utf8mb4', $this->model->charset);
7979

8080
// from Builder
8181
$this->assertTrue(isset($this->model->QBNoEscape));

0 commit comments

Comments
 (0)