Skip to content

Commit 688b7a6

Browse files
authored
Merge pull request #209 from devenbansod/test/create-replace-view
Add tests for builder of CREATE or REPLACE VIEW statement Signed-off-by: William Desportes <[email protected]>
2 parents 64c999b + 64ffe88 commit 688b7a6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Builder/CreateStatementTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,18 @@ public function testBuilderView()
271271
'SELECT id, first_name FROM employee WHERE id = 1 ',
272272
$stmt->build()
273273
);
274+
275+
$parser = new Parser(
276+
'CREATE OR REPLACE VIEW myView (vid, vfirstname) AS ' .
277+
'SELECT id, first_name FROM employee WHERE id = 1'
278+
);
279+
$stmt = $parser->statements[0];
280+
281+
$this->assertEquals(
282+
'CREATE OR REPLACE VIEW myView (vid, vfirstname) AS ' .
283+
'SELECT id, first_name FROM employee WHERE id = 1 ',
284+
$stmt->build()
285+
);
274286
}
275287

276288
public function testBuilderTrigger()

0 commit comments

Comments
 (0)