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
|
|
|
|