diff options
Diffstat (limited to 'tests/Builder/ExplainStatementTest.php')
-rw-r--r-- | tests/Builder/ExplainStatementTest.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Builder/ExplainStatementTest.php b/tests/Builder/ExplainStatementTest.php new file mode 100644 index 0000000..7b6215f --- /dev/null +++ b/tests/Builder/ExplainStatementTest.php @@ -0,0 +1,23 @@ +<?php +declare(strict_types=1); + +namespace PhpMyAdmin\SqlParser\Tests\Builder; + +use PhpMyAdmin\SqlParser\Parser; +use PhpMyAdmin\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() + ); + } +} |