Passed
Push — master ( 9dbeef...fdd166 )
by Petr
07:45
created

BasicTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 15
c 2
b 0
f 1
dl 0
loc 23
rs 10
wmc 2
1
<?php
2
3
namespace BasicTests;
4
5
6
use CommonTestClass;
7
use kalanis\kw_paging\Render\THelpingText;
8
use kalanis\kw_paging\Render\Translations;
9
10
11
class BasicTest extends CommonTestClass
12
{
13
    public function testPositions(): void
14
    {
15
        $position = $this->getPositions();
16
        $position->getPager()->setActualPage(4);
17
        $this->assertTrue($position->prevPageExists());
18
        $this->assertTrue($position->nextPageExists());
19
20
        $position->getPager()->setActualPage($position->getFirstPage());
21
        $this->assertFalse($position->prevPageExists());
22
        $position->getPager()->setActualPage($position->getLastPage());
23
        $this->assertFalse($position->nextPageExists());
24
    }
25
26
    public function testTranslations(): void
27
    {
28
        $position = $this->getPositions();
29
        $position->getPager()->setActualPage(4);
30
        $lib = new HelpingText();
31
        $this->assertEmpty($lib->getFilledText($position));
32
        $lib->setLang(new Translations());
33
        $this->assertNotEmpty($lib->getFilledText($position));
34
    }
35
}
36
37
38
class HelpingText
39
{
40
    use THelpingText;
41
}
42