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

BasicTest::testTranslations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 6
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 8
rs 10
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