Completed
Pull Request — master (#304)
by Benoît
03:33
created

CursorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 2 Features 0
Metric Value
wmc 1
c 2
b 2
f 0
lcom 0
cbo 2
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCursor() 0 19 1
1
<?php
2
3
namespace League\Fractal\Test\Pagination;
4
5
use League\Fractal\Pagination\Cursor;
6
7
class CursorTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testCursor()
10
    {
11
        $cursor = new Cursor(100, 90, 110, 10);
12
13
        $this->assertSame($cursor->getCurrent(), 100);
14
        $this->assertSame($cursor->getPrev(), 90);
15
        $this->assertSame($cursor->getNext(), 110);
16
        $this->assertSame($cursor->getCount(), 10);
17
18
        $cursor->setCurrent(110);
19
        $cursor->setPrev(106);
20
        $cursor->setNext(114);
21
        $cursor->setCount(4);
22
23
        $this->assertSame($cursor->getCurrent(), 110);
24
        $this->assertSame($cursor->getPrev(), 106);
25
        $this->assertSame($cursor->getNext(), 114);
26
        $this->assertSame($cursor->getCount(), 4);
27
    }
28
}
29