Passed
Push — master ( 4d86c4...586e6b )
by Alex
02:58
created

NoItemsViewUnitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

1 Method

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