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

LimitTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A parseProvider() 0 5 1
A testParse() 0 3 1
A testBuildWithOffset() 0 4 1
A testBuildWithoutOffset() 0 4 1
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