testNewMaterialDesignIconicFontBreadcrumbNodes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 22
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Tests\Factory;
13
14
use WBW\Bundle\CoreBundle\Factory\FOSUserNavigationFactory;
15
use WBW\Bundle\CoreBundle\Tests\AbstractTestCase;
16
use WBW\Library\Symfony\Assets\Navigation\BreadcrumbNode;
17
use WBW\Library\Symfony\Assets\NavigationNodeInterface;
18
19
/**
20
 * FOS user navigation factory test.
21
 *
22
 * @author webeweb <https://github.com/webeweb>
23
 * @package WBW\Bundle\CoreBundle\Tests\Factory
24
 */
25
class FOSUserNavigationFactoryTest extends AbstractTestCase {
26
27
    /**
28
     * Test newFontAwesomeBreadcrumbNodes()
29
     *
30
     * @return void
31
     */
32
    public function testNewFontAwesomeBreadcrumbNodes(): void {
33
34
        $res = FOSUserNavigationFactory::newFontAwesomeBreadcrumbNodes();
35
        $this->assertCount(3, $res);
36
37
        $this->assertInstanceOf(BreadcrumbNode::class, $res[0]);
38
        $this->assertEquals("label.edit_profile", $res[0]->getLabel());
39
        $this->assertEquals("fa:user", $res[0]->getIcon());
40
        $this->assertEquals("fos_user_profile_edit", $res[0]->getUri());
41
        $this->assertEquals(NavigationNodeInterface::MATCHER_ROUTER, $res[0]->getMatcher());
42
43
        $this->assertInstanceOf(BreadcrumbNode::class, $res[1]);
44
        $this->assertEquals("label.show_profile", $res[1]->getLabel());
45
        $this->assertEquals("fa:user", $res[1]->getIcon());
46
        $this->assertEquals("fos_user_profile_show", $res[1]->getUri());
47
        $this->assertEquals(NavigationNodeInterface::MATCHER_ROUTER, $res[1]->getMatcher());
48
49
        $this->assertInstanceOf(BreadcrumbNode::class, $res[2]);
50
        $this->assertEquals("label.change_password", $res[2]->getLabel());
51
        $this->assertEquals("fa:lock", $res[2]->getIcon());
52
        $this->assertEquals("fos_user_change_password", $res[2]->getUri());
53
        $this->assertEquals(NavigationNodeInterface::MATCHER_ROUTER, $res[2]->getMatcher());
54
    }
55
56
    /**
57
     * Test newMaterialDesignIconicFontBreadcrumbNodes()
58
     *
59
     * @return void
60
     */
61
    public function testNewMaterialDesignIconicFontBreadcrumbNodes(): void {
62
63
        $res = FOSUserNavigationFactory::newMaterialDesignIconicFontBreadcrumbNodes();
64
        $this->assertCount(3, $res);
65
66
        $this->assertInstanceOf(BreadcrumbNode::class, $res[0]);
67
        $this->assertEquals("label.edit_profile", $res[0]->getLabel());
68
        $this->assertEquals("zmdi:account", $res[0]->getIcon());
69
        $this->assertEquals("fos_user_profile_edit", $res[0]->getUri());
70
        $this->assertEquals(NavigationNodeInterface::MATCHER_ROUTER, $res[0]->getMatcher());
71
72
        $this->assertInstanceOf(BreadcrumbNode::class, $res[1]);
73
        $this->assertEquals("label.show_profile", $res[1]->getLabel());
74
        $this->assertEquals("zmdi:account", $res[1]->getIcon());
75
        $this->assertEquals("fos_user_profile_show", $res[1]->getUri());
76
        $this->assertEquals(NavigationNodeInterface::MATCHER_ROUTER, $res[1]->getMatcher());
77
78
        $this->assertInstanceOf(BreadcrumbNode::class, $res[2]);
79
        $this->assertEquals("label.change_password", $res[2]->getLabel());
80
        $this->assertEquals("zmdi:lock", $res[2]->getIcon());
81
        $this->assertEquals("fos_user_change_password", $res[2]->getUri());
82
        $this->assertEquals(NavigationNodeInterface::MATCHER_ROUTER, $res[2]->getMatcher());
83
    }
84
}
85