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

LimitTest::testParse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace PhpMyAdmin\SqlParser\Tests\Components;
4
5
use PhpMyAdmin\SqlParser\Components\Limit;
6
use PhpMyAdmin\SqlParser\Tests\TestCase;
7
8
class LimitTest extends TestCase
9
{
10
    public function testBuildWithoutOffset()
11
    {
12
        $component = new Limit(1);
13
        $this->assertEquals(Limit::build($component), '0, 1');
14
    }
15
16
    public function testBuildWithOffset()
17
    {
18
        $component = new Limit(1, 2);
19
        $this->assertEquals(Limit::build($component), '2, 1');
20
    }
21
22
    /**
23
     * @dataProvider parseProvider
24
     *
25
     * @param mixed $test
26
     */
27
    public function testParse($test)
28
    {
29
        $this->runParserTest($test);
30
    }
31
32
    public function parseProvider()
33
    {
34
        return array(
35
            array('parser/parseLimitErr1'),
36
            array('parser/parseLimitErr2')
37
        );
38
    }
39
}
40