Passed
Pull Request — master (#311)
by William
12:43
created

LoadStatementTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 19
c 2
b 0
f 0
dl 0
loc 35
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A loadProvider() 0 15 1
A testLoad() 0 3 1
A testLoadOptions() 0 6 1
1
<?php
2
3
namespace PhpMyAdmin\SqlParser\Tests\Parser;
4
5
use PhpMyAdmin\SqlParser\Parser;
6
use PhpMyAdmin\SqlParser\Tests\TestCase;
7
8
class LoadStatementTest extends TestCase
9
{
10
    public function testLoadOptions()
11
    {
12
        $data = $this->getData('parser/parseLoad1');
13
        $parser = new Parser($data['query']);
14
        $stmt = $parser->statements[0];
15
        $this->assertEquals(10, $stmt->options->has('CONCURRENT'));
16
    }
17
18
    /**
19
     * @dataProvider loadProvider
20
     *
21
     * @param mixed $test
22
     */
23
    public function testLoad($test)
24
    {
25
        $this->runParserTest($test);
26
    }
27
28
    public function loadProvider()
29
    {
30
        return array(
31
            array('parser/parseLoad1'),
32
            array('parser/parseLoad2'),
33
            array('parser/parseLoad3'),
34
            array('parser/parseLoad4'),
35
            array('parser/parseLoad5'),
36
            array('parser/parseLoad6'),
37
            array('parser/parseLoadErr1'),
38
            array('parser/parseLoadErr2'),
39
            array('parser/parseLoadErr3'),
40
            array('parser/parseLoadErr4'),
41
            array('parser/parseLoadErr5'),
42
            array('parser/parseLoadErr6')
43
        );
44
    }
45
}
46