Issues (10)

tests/src/Breadcrumbs/TrailTest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace ByTIC\Navigation\Tests\Breadcrumbs;
4
5
use ByTIC\Navigation\Breadcrumbs\Trail;
6
use ByTIC\Navigation\Tests\AbstractTest;
7
8
/**
9
 * Class TrailTest
10
 * @package ByTIC\Navigation\Tests\Breadcrumbs
11
 */
12
class TrailTest extends AbstractTest
13
{
14
    public function test_render_emptyBreadcrumbs()
15
    {
16
        $trail = new Trail();
17
18
        $content = $trail->render();
19
        self::assertEmpty($content);
20
    }
21
22
    public function test_render()
23
    {
24
        $trail = new Trail();
25
        $trail->addItem('t1', '#');
0 ignored issues
show
The method addItem() does not exist on ByTIC\Navigation\Breadcrumbs\Trail. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
        $trail->/** @scrutinizer ignore-call */ 
26
                addItem('t1', '#');
Loading history...
26
        $trail->addItem('t2', '#');
27
28
        $content = $trail->render();
29
        $testContent = file_get_contents(TEST_FIXTURE_PATH . '/views-rendered/breadcrumbs/basic-bootstrap4.html');
30
        self::assertSame($testContent, $content);
31
    }
32
}
33