Completed
Push — master ( 0e2bb1...d48330 )
by WEBEWEB
02:01
created

DividerNodeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 38
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testAddNode() 0 13 1
A test__construct() 0 11 1
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\Navigation;
13
14
use WBW\Bundle\CoreBundle\Navigation\DividerNode;
15
use WBW\Bundle\CoreBundle\Tests\AbstractTestCase;
16
use WBW\Bundle\CoreBundle\Tests\Fixtures\Navigation\TestNavigationNode;
17
18
/**
19
 * Divider node test.
20
 *
21
 * @author webeweb <https://github.com/webeweb/>
22
 * @package WBW\Bundle\CoreBundle\Tests\Navigation
23
 */
24
class DividerNodeTest extends AbstractTestCase {
25
26
    /**
27
     * Tests the addNode() method.
28
     *
29
     * @return void
30
     */
31
    public function testAddNode(): void {
32
33
        // Set a Navigation node mock.
34
        $node = new TestNavigationNode("node");
35
36
        $obj = new DividerNode("id");
37
38
        $this->assertSame($obj, $obj->addNode($node));
39
        $this->assertEquals([], $obj->getNodes());
40
41
        $this->assertNull($node->getParent());
42
        $this->assertNull($node->getAlphabeticalTreeNodeParent());
43
    }
44
45
    /**
46
     * Tests the __construct() method.
47
     *
48
     * @return void
49
     */
50
    public function test__construct(): void {
51
52
        $obj = new DividerNode("id");
53
54
        $this->assertFalse($obj->getActive());
55
        $this->assertTrue($obj->getEnable());
56
        $this->assertNull($obj->getIcon());
57
        $this->assertNull($obj->getMatcher());
58
        $this->assertNull($obj->getUri());
59
        $this->assertTrue($obj->getVisible());
60
    }
61
}
62