summaryrefslogtreecommitdiffstats
path: root/tests/Builder/ExplainStatement.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-07-03 21:18:10 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-07-04 23:41:52 +0300
commitb3eff80030f9bd6d90e65360eb89e18a1be298b2 (patch)
treedb420fef27f24856f4cfaeee008104fdfcb77942 /tests/Builder/ExplainStatement.php
parent4dabcc2ae266c022e44294bfbe3344b05e66e266 (diff)
downloadsql-parser-b3eff80030f9bd6d90e65360eb89e18a1be298b2.zip
sql-parser-b3eff80030f9bd6d90e65360eb89e18a1be298b2.tar.gz
sql-parser-b3eff80030f9bd6d90e65360eb89e18a1be298b2.tar.bz2
The context depends on the SQL mode.
Implemented a few more builders. Improved some fragments and statement types. Fixed the noAlias option in FieldFragment. Reordered CREATE statements's options. Updated contexts definitions. Fixed typos. Improved tests.
Diffstat (limited to 'tests/Builder/ExplainStatement.php')
-rw-r--r--tests/Builder/ExplainStatement.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/Builder/ExplainStatement.php b/tests/Builder/ExplainStatement.php
new file mode 100644
index 0000000..1a44f44
--- /dev/null
+++ b/tests/Builder/ExplainStatement.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace SqlParser\Tests\Builder;
+
+use SqlParser\Parser;
+
+use SqlParser\Tests\TestCase;
+
+class ExplainStatementTest extends TestCase
+{
+
+ public function testBuilderView()
+ {
+ $query = 'EXPLAIN SELECT * FROM test;';
+
+ $parser = new Parser($query);
+ $stmt = $parser->statements[0];
+
+ $this->assertEquals(
+ ' EXPLAIN SELECT * FROM test',
+ $stmt->build()
+ );
+ }
+}