Skip to content

Commit

Permalink
Merge pull request #209 from devenbansod/test/create-replace-view
Browse files Browse the repository at this point in the history
Add tests for builder of CREATE or REPLACE VIEW statement

Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Dec 20, 2018
2 parents 64c999b + 64ffe88 commit 688b7a6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Builder/CreateStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ public function testBuilderView()
'SELECT id, first_name FROM employee WHERE id = 1 ',
$stmt->build()
);

$parser = new Parser(
'CREATE OR REPLACE VIEW myView (vid, vfirstname) AS ' .
'SELECT id, first_name FROM employee WHERE id = 1'
);
$stmt = $parser->statements[0];

$this->assertEquals(
'CREATE OR REPLACE VIEW myView (vid, vfirstname) AS ' .
'SELECT id, first_name FROM employee WHERE id = 1 ',
$stmt->build()
);
}

public function testBuilderTrigger()
Expand Down

0 comments on commit 688b7a6

Please sign in to comment.