diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Builder/InsertStatementTest.php | 11 | ||||
-rw-r--r-- | tests/Builder/ReplaceStatementTest.php | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/Builder/InsertStatementTest.php b/tests/Builder/InsertStatementTest.php index 84daf3a..cf46143 100644 --- a/tests/Builder/InsertStatementTest.php +++ b/tests/Builder/InsertStatementTest.php @@ -63,5 +63,16 @@ class InsertStatementTest extends TestCase 'INSERT INTO tbl SELECT * FROM bar ON DUPLICATE KEY UPDATE baz = 1', $stmt->build() ); + + /* Assertion 6 */ + /* INSERT [OPTIONS] INTO ... */ + $parser = new Parser( + 'INSERT DELAYED IGNORE INTO tbl SELECT * FROM bar' + ); + $stmt = $parser->statements[0]; + $this->assertEquals( + 'INSERT DELAYED IGNORE INTO tbl SELECT * FROM bar', + $stmt->build() + ); } } diff --git a/tests/Builder/ReplaceStatementTest.php b/tests/Builder/ReplaceStatementTest.php index ad0c141..ee5b95a 100644 --- a/tests/Builder/ReplaceStatementTest.php +++ b/tests/Builder/ReplaceStatementTest.php @@ -43,4 +43,16 @@ class ReplaceStatementTest extends TestCase $stmt->build() ); } + + public function testBuilderSelectDelayed() + { + $parser = new Parser( + 'REPLACE DELAYED INTO tbl(col1, col2, col3) SELECT col1, col2, col3 FROM tbl2' + ); + $stmt = $parser->statements[0]; + $this->assertEquals( + 'REPLACE DELAYED INTO tbl(`col1`, `col2`, `col3`) SELECT col1, col2, col3 FROM tbl2', + $stmt->build() + ); + } } |