Skip to content

Commit 64ffe88

Browse files
committed
Add tests for builder of CREATE or REPLACE VIEW
Signed-off-by: Deven Bansod <[email protected]>
1 parent 5e8dbcf commit 64ffe88

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)