Skip to content

Commit 94eaf09

Browse files
committed
test: add test for getOriginalQuery()
1 parent 1b7bc3d commit 94eaf09

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/system/Database/Builder/InsertTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ public function testInsertBatch()
9191
$query = $this->db->getLastQuery();
9292
$this->assertInstanceOf(Query::class, $query);
9393

94+
$raw = <<<'SQL'
95+
INSERT INTO "jobs" ("description", "id", "name") VALUES ('There''s something in your teeth',2,'Commedian'), ('I am yellow',3,'Cab Driver')
96+
SQL;
97+
$this->assertSame($raw, str_replace("\n", ' ', $query->getOriginalQuery()));
98+
9499
$expected = "INSERT INTO \"jobs\" (\"description\", \"id\", \"name\") VALUES ('There''s something in your teeth',2,'Commedian'), ('I am yellow',3,'Cab Driver')";
95100
$this->assertSame($expected, str_replace("\n", ' ', $query->getQuery()));
96101
}

0 commit comments

Comments
 (0)