File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace PhpMyAdmin \SqlParser \Tests \Builder ;
4
+
5
+ use PhpMyAdmin \SqlParser \Parser ;
6
+ use PhpMyAdmin \SqlParser \Tests \TestCase ;
7
+
8
+ class CallStatementTest extends TestCase
9
+ {
10
+ public function testBuilder ()
11
+ {
12
+ $ query = 'CALL foo() ' ;
13
+
14
+ $ parser = new Parser ($ query );
15
+ $ stmt = $ parser ->statements [0 ];
16
+
17
+ $ this ->assertEquals ($ query , $ stmt ->build ());
18
+ }
19
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace PhpMyAdmin \SqlParser \Tests \Builder ;
4
+
5
+ use PhpMyAdmin \SqlParser \Parser ;
6
+ use PhpMyAdmin \SqlParser \Tests \TestCase ;
7
+
8
+ class TruncateStatementTest extends TestCase
9
+ {
10
+ public function testBuilder ()
11
+ {
12
+ $ query = 'TRUNCATE TABLE mytable; ' ;
13
+
14
+ $ parser = new Parser ($ query );
15
+ $ stmt = $ parser ->statements [0 ];
16
+
17
+ $ this ->assertEquals ($ query , $ stmt ->build ());
18
+ }
19
+
20
+ public function testBuilderDbtable ()
21
+ {
22
+ $ query = 'TRUNCATE TABLE mydb.mytable; ' ;
23
+
24
+ $ parser = new Parser ($ query );
25
+ $ stmt = $ parser ->statements [0 ];
26
+
27
+ $ this ->assertEquals ($ query , $ stmt ->build ());
28
+ }
29
+
30
+ public function testBuilderDbtableBackQuotes ()
31
+ {
32
+ $ query = 'TRUNCATE TABLE `mydb`.`mytable`; ' ;
33
+
34
+ $ parser = new Parser ($ query );
35
+ $ stmt = $ parser ->statements [0 ];
36
+
37
+ $ this ->assertEquals ($ query , $ stmt ->build ());
38
+ }
39
+
40
+ }
You can’t perform that action at this time.
0 commit comments