Passed
Push — master ( 39e51c...ca88cb )
by Alex
03:38
created

NoItemsViewUnitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 20
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testNoItemsView() 0 14 1
1
<?php
2
namespace Mezon\Gui\Tests\Common;
3
4
use Mezon\Gui\ListBuilder;
5
use Mezon\Gui\Tests\FakeAdapter;
6
use Mezon\Gui\Tests\ListBuilderTestsBase;
7
8
class NoItemsViewUnitTest extends ListBuilderTestsBase
9
{
10
11
    /**
12
     * Testing no items view
13
     */
14
    public function testNoItemsView(): void
15
    {
16
        // setup
17
        $listBuilder = new ListBuilder\Common($this->getFields(), new FakeAdapter([]));
18
        $listBuilder->setNoItemsView('no items!');
19
        $listBuilder->listTitle = 'title';
20
21
        // test body
22
        $result = $listBuilder->listingForm();
23
24
        // assertions
25
        $this->assertStringContainsString('title', $result);
26
        $this->assertStringContainsString('Ни одной записи не найдено', $result);
27
        $this->assertStringContainsString('no items!', $result);
28
    }
29
}
30