Passed
Push — main ( d95b4b...96e631 )
by Sammy
01:51
created

LimitTest::testLimitWithDefaultOffset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
3
use PHPUnit\Framework\TestCase;
4
use HexMakina\Crudites\Grammar\Clause\Limit;
5
6
class LimitTest extends TestCase
7
{
8
    public function testLimitWithDefaultOffset()
9
    {
10
        $limit = new Limit(10);
11
        $this->assertEquals('LIMIT 10 OFFSET 0', (string)$limit);
12
    }
13
14
    public function testLimitWithCustomOffset()
15
    {
16
        $limit = new Limit(10, 5);
17
        $this->assertEquals('LIMIT 10 OFFSET 5', (string)$limit);
18
    }
19
20
    public function testLimitName()
21
    {
22
        $limit = new Limit(10);
23
        $this->assertEquals('LIMIT', $limit->name());
24
    }
25
}