Passed
Push — master ( 383493...d29574 )
by Chito
02:01
created

PaginatorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
eloc 22
c 1
b 1
f 0
dl 0
loc 30
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testDebugInfo() 0 28 1
1
<?php
2
3
namespace Lampager\Cake\Test\TestCase;
4
5
use Lampager\Cake\ORM\Query;
6
use Lampager\Cake\Paginator;
7
use Lampager\Query\Order;
8
use PHPUnit\Framework\MockObject\MockObject;
9
10
class PaginatorTest extends TestCase
11
{
12
    public function testDebugInfo()
13
    {
14
        /** @var MockObject&Query */
15
        $builder = $this->getMockBuilder(Query::class)
16
            ->disableOriginalConstructor()
17
            ->getMock();
18
19
        $paginator = (new Paginator($builder))
20
            ->orderBy('modified')
21
            ->orderBy('id')
22
            ->limit(3)
23
            ->forward()
24
            ->inclusive()
25
            ->seekable();
26
27
        $actual = $paginator->__debugInfo();
28
        $this->assertEquals([
29
            'query' => [
30
                'orders' => [
31
                    new Order('modified', 'asc'),
32
                    new Order('id', 'asc'),
33
                ],
34
                'limit' => 3,
35
                'forward' => true,
36
                'inclusive' => true,
37
                'seekable' => true,
38
            ],
39
        ], $actual);
40
    }
41
}
42