Completed
Push — develop ( cf0b6f...baacde )
by Bartko
06:00
created

NodeInfoTest::testNodeInfoWithScope()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 11
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
namespace StefanoTreeTest\Unit\NestedSet;
3
4
use StefanoTree\NestedSet\NodeInfo;
5
6
class NodeInfoTest
7
    extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style introduced by
The extends keyword must be on the same line as the class name
Loading history...
8
{
9
    public function testNodeInfoWithScope()
10
    {
11
        $nodeInfo = new NodeInfo(11, 29, 33, 44, 62, 45);
12
13
        $this->assertEquals(11, $nodeInfo->getId());
14
        $this->assertEquals(29, $nodeInfo->getParentId());
15
        $this->assertEquals(33, $nodeInfo->getLevel());
16
        $this->assertEquals(44, $nodeInfo->getLeft());
17
        $this->assertEquals(62, $nodeInfo->getRight());
18
        $this->assertEquals(45, $nodeInfo->getScope());
19
    }
20
21
    public function testIsNotRoot()
22
    {
23
        $nodeInfo = new NodeInfo(11, 29, 33, 44, 62, null);
24
25
        $this->assertFalse($nodeInfo->isRoot());
26
    }
27
28
    public function testIsRoot()
29
    {
30
        $nodeInfo = new NodeInfo(125, 0, 0, 1, 156, null);
31
32
        $this->assertTrue($nodeInfo->isRoot());
33
    }
34
}
35