Skip to content

Commit

Permalink
Update SQL tests to consistently pass (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
chitoku-k authored Jan 31, 2020
1 parent 5f7af36 commit 6c31f6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions tests/TestCase/Database/SqliteCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -51,27 +51,27 @@ 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
*
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
)
';

Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . '&quoteIdentifiers=true');
}

ConnectionManager::setConfig('test', [
Expand Down

0 comments on commit 6c31f6f

Please sign in to comment.