Skip to content

Commit 2d64c08

Browse files
committed
tests for CREATE TABLE IF NOT EXISTS foo and CREATE TABLE foo LIKE bar
1 parent 713011e commit 2d64c08

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/TablePropsTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,24 @@ function testGeneralCreation(){
6969
$this->assertEquals($tbl['name'], "foo");
7070
$this->assertEquals($tbl['props']['temporary'], true);
7171
}
72+
73+
function testIfNotExists(){
74+
75+
$tbl1 = $this->get_first_table("CREATE TABLE bar");
76+
$tbl2 = $this->get_first_table("CREATE TABLE IF NOT EXISTS bar");
77+
78+
# these props wont match, since it's the src sql
79+
unset($tbl1['sql']);
80+
unset($tbl2['sql']);
81+
82+
$this->assertEquals(var_export($tbl1, true), var_export($tbl2, true));
83+
}
84+
85+
function testCreateTableLike(){
86+
87+
$tbl = $this->get_first_table("CREATE TABLE foo LIKE `bar`");
88+
89+
$this->assertEquals($tbl['name'], "foo");
90+
$this->assertEquals($tbl['like'], "bar");
91+
}
7292
}

0 commit comments

Comments
 (0)