Skip to content

Commit cf44600

Browse files
committed
Add builders test for end options in SELECT
Signed-off-by: Deven Bansod <[email protected]>
1 parent 80d5eb5 commit cf44600

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/Builder/SelectStatementTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,27 @@ public function testBuilderAlias()
5353
$stmt->build()
5454
);
5555
}
56+
57+
public function testBuilderEndOptions()
58+
{
59+
/* Assertion 1 */
60+
$query = 'SELECT pid, name2 FROM tablename WHERE pid = 20 FOR UPDATE ';
61+
$parser = new Parser($query);
62+
$stmt = $parser->statements[0];
63+
64+
$this->assertEquals(
65+
$query,
66+
$stmt->build()
67+
);
68+
69+
/* Assertion 2 */
70+
$query = 'SELECT pid, name2 FROM tablename WHERE pid = 20 LOCK IN SHARE MODE ';
71+
$parser = new Parser($query);
72+
$stmt = $parser->statements[0];
73+
74+
$this->assertEquals(
75+
$query,
76+
$stmt->build()
77+
);
78+
}
5679
}

0 commit comments

Comments
 (0)