NestedIntervalsQueryTraitTestCase   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRoots() 0 5 1
1
<?php
2
/**
3
 * @link https://github.com/paulzi/yii2-nested-intervals
4
 * @copyright Copyright (c) 2015 PaulZi <[email protected]>
5
 * @license MIT (https://github.com/paulzi/yii2-nested-intervals/blob/master/LICENSE)
6
 */
7
8
namespace paulzi\nestedintervals\tests;
9
10
use paulzi\nestedintervals\tests\models\Node;
11
use paulzi\nestedintervals\tests\models\MultipleTreeNode;
12
use Yii;
13
14
/**
15
 * @author PaulZi <[email protected]>
16
 */
17
class NestedIntervalsQueryTraitTestCase extends BaseTestCase
18
{
19
    public function testRoots()
20
    {
21
        $this->assertEquals([1], array_map(function ($value) { return $value->id; }, Node::find()->roots()->all()));
22
        $this->assertEquals([1, 26], array_map(function ($value) { return $value->id; }, MultipleTreeNode::find()->roots()->all()));
23
    }
24
}