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

NodeInfoTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 6
Bugs 1 Features 1
Metric Value
wmc 3
c 6
b 1
f 1
lcom 0
cbo 2
dl 0
loc 29
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testNodeInfoWithScope() 0 11 1
A testIsNotRoot() 0 6 1
A testIsRoot() 0 6 1
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