summaryrefslogtreecommitdiffstats
path: root/tests/Builder/ExplainStatementTest.php
blob: 7b6215f55e2ce6f503bf738a55e833fb8cb06b00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()
        );
    }
}