forked from Codeception/module-db
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bugfix] Codeception#47 Malformed UTF-8 characters, possibly incorrec…
…tly encoded
- Loading branch information
sm
committed
Mar 15, 2023
1 parent
0ff3582
commit 8dd6d2f
Showing
6 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ insert into `groups`(`id`,`name`,`enabled`,`created_at`) values (2,'jazzman',0, | |
|
||
CREATE TABLE `users` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`uuid` binary(16) DEFAULT NULL, | ||
`name` varchar(30) DEFAULT NULL, | ||
`email` varchar(255) DEFAULT NULL, | ||
`is_active` bit(1) DEFAULT b'1', | ||
|
@@ -24,13 +25,13 @@ CREATE TABLE `users` ( | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
|
||
insert into `users`(`id`,`name`,`email`, `is_active`,`created_at`) values (1,'davert','[email protected]', b'1','2012-02-01 21:17:04'); | ||
insert into `users`(`id`,`uuid`, `name`,`email`, `is_active`,`created_at`) values (1,0x11edc34b01d972fa9c1d0242ac120006,'davert','[email protected]', b'1','2012-02-01 21:17:04'); | ||
|
||
insert into `users`(`id`,`name`,`email`, `is_active`,`created_at`) values (2,'nick','[email protected]', b'1','2012-02-01 21:17:15'); | ||
insert into `users`(`id`,`uuid`, `name`,`email`, `is_active`,`created_at`) values (2,null,'nick','[email protected]', b'1','2012-02-01 21:17:15'); | ||
|
||
insert into `users`(`id`,`name`,`email`, `is_active`,`created_at`) values (3,'miles','[email protected]', b'1','2012-02-01 21:17:25'); | ||
insert into `users`(`id`,`uuid`, `name`,`email`, `is_active`,`created_at`) values (3,null,'miles','[email protected]', b'1','2012-02-01 21:17:25'); | ||
|
||
insert into `users`(`id`,`name`,`email`, `is_active`,`created_at`) values (4,'bird','[email protected]', b'0','2012-02-01 21:17:39'); | ||
insert into `users`(`id`,`uuid`, `name`,`email`, `is_active`,`created_at`) values (4,null,'bird','[email protected]', b'0','2012-02-01 21:17:39'); | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,11 @@ INSERT INTO "permissions" VALUES(5,3,2,'member'); | |
INSERT INTO "permissions" VALUES(7,4,2,'admin'); | ||
|
||
DROP TABLE IF EXISTS "users"; | ||
CREATE TABLE "users" ("name" VARCHAR, "email" VARCHAR, "created_at" DATETIME DEFAULT CURRENT_TIMESTAMP); | ||
INSERT INTO "users" VALUES('davert','[email protected]','2012-02-01 21:17:04'); | ||
INSERT INTO "users" VALUES('nick','[email protected]','2012-02-01 21:17:15'); | ||
INSERT INTO "users" VALUES('miles','[email protected]','2012-02-01 21:17:25'); | ||
INSERT INTO "users" VALUES('bird','[email protected]','2012-02-01 21:17:39'); | ||
CREATE TABLE "users" ("name" VARCHAR, "uuid" BLOB DEFAULT NULL, "email" VARCHAR, "created_at" DATETIME DEFAULT CURRENT_TIMESTAMP); | ||
INSERT INTO "users" VALUES('davert',X'11edc34b01d972fa9c1d0242ac120006','[email protected]','2012-02-01 21:17:04'); | ||
INSERT INTO "users" VALUES('nick',null,'[email protected]','2012-02-01 21:17:15'); | ||
INSERT INTO "users" VALUES('miles',null,'[email protected]','2012-02-01 21:17:25'); | ||
INSERT INTO "users" VALUES('bird',null,'[email protected]','2012-02-01 21:17:39'); | ||
|
||
DROP TABLE IF EXISTS "empty_table"; | ||
CREATE TABLE "empty_table" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , "field" VARCHAR); | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,20 +64,27 @@ public function testConnectionIsKeptForTheWholeSuite() | |
$this->module->_afterSuite(); | ||
} | ||
|
||
public function testSeeInDatabaseWithBinary() | ||
{ | ||
$this->module->seeInDatabase('users', ['uuid' => hex2bin('11edc34b01d972fa9c1d0242ac120006')]); | ||
} | ||
|
||
public function testSeeInDatabase() | ||
{ | ||
$this->module->seeInDatabase('users', ['name' => 'davert']); | ||
} | ||
|
||
public function testCountInDatabase() | ||
{ | ||
$this->module->seeNumRecords(1, 'users', ['uuid' => hex2bin('11edc34b01d972fa9c1d0242ac120006')]); | ||
$this->module->seeNumRecords(1, 'users', ['name' => 'davert']); | ||
$this->module->seeNumRecords(0, 'users', ['name' => 'davert', 'email' => '[email protected]']); | ||
$this->module->seeNumRecords(0, 'users', ['name' => 'user1']); | ||
} | ||
|
||
public function testDontSeeInDatabase() | ||
{ | ||
$this->module->dontSeeInDatabase('users', ['uuid' => hex2bin('ffffffffffffffffffffffffffffffff')]); | ||
$this->module->dontSeeInDatabase('users', ['name' => 'user1']); | ||
} | ||
|
||
|