From 6c31f6f518ec8aed953e1158e29870a1af9e593c Mon Sep 17 00:00:00 2001 From: Chitoku Date: Fri, 31 Jan 2020 12:23:14 +0900 Subject: [PATCH] Update SQL tests to consistently pass (#21) --- .../TestCase/Database/SqliteCompilerTest.php | 24 +++++++++---------- tests/bootstrap.php | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/TestCase/Database/SqliteCompilerTest.php b/tests/TestCase/Database/SqliteCompilerTest.php index f04a532..f374d4d 100644 --- a/tests/TestCase/Database/SqliteCompilerTest.php +++ b/tests/TestCase/Database/SqliteCompilerTest.php @@ -26,11 +26,11 @@ public function testSelect(): void $expected = ' SELECT - Posts.* AS "Posts__*" + "Posts".* AS "Posts__*" FROM - posts Posts + "posts" "Posts" ORDER BY - modified ASC + "modified" ASC '; $actual = $posts->find() @@ -51,14 +51,14 @@ public function testUnion(): void FROM ( SELECT - Posts.id AS "Posts__id", - Posts.modified AS "Posts__modified" + "Posts"."id" AS "Posts__id", + "Posts"."modified" AS "Posts__modified" FROM - posts Posts + "posts" "Posts" WHERE - id > :c0 + "id" > :c0 ORDER BY - modified ASC + "modified" ASC ) UNION ALL SELECT @@ -66,12 +66,12 @@ public function testUnion(): void FROM ( SELECT - Posts.id AS "Posts__id", - Posts.modified AS "Posts__modified" + "Posts"."id" AS "Posts__id", + "Posts"."modified" AS "Posts__modified" FROM - posts Posts + "posts" "Posts" ORDER BY - modified ASC + "modified" ASC ) '; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d7a5500..850b28a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -35,7 +35,7 @@ ]); if (!getenv('DB_DSN')) { - putenv('DB_DSN=sqlite:///:memory:?className=' . Connection::class . '&driver=' . Sqlite::class); + putenv('DB_DSN=sqlite:///:memory:?className=' . Connection::class . '&driver=' . Sqlite::class . '"eIdentifiers=true'); } ConnectionManager::setConfig('test', [