@@ 156-166 (lines=11) @@ | ||
153 | $this->assertEquals(true, $node->isRelationPopulated('children')); |
|
154 | } |
|
155 | ||
156 | public function testIsRoot() |
|
157 | { |
|
158 | $this->assertTrue(Node::findOne(1)->isRoot()); |
|
159 | $this->assertFalse(Node::findOne(3)->isRoot()); |
|
160 | ||
161 | $this->assertTrue(AttributeModeNode::findOne(1)->isRoot()); |
|
162 | $this->assertFalse(AttributeModeNode::findOne(3)->isRoot()); |
|
163 | ||
164 | $this->assertTrue(MultipleTreeNode::findOne(1)->isRoot()); |
|
165 | $this->assertFalse(MultipleTreeNode::findOne(3)->isRoot()); |
|
166 | } |
|
167 | ||
168 | public function testIsChildOf() |
|
169 | { |
|
@@ 192-202 (lines=11) @@ | ||
189 | $this->assertFalse(MultipleTreeNode::findOne(9)->isChildOf(MultipleTreeNode::findOne(16))); |
|
190 | } |
|
191 | ||
192 | public function testIsLeaf() |
|
193 | { |
|
194 | $this->assertTrue(Node::findOne(5)->isLeaf()); |
|
195 | $this->assertFalse(Node::findOne(2)->isLeaf()); |
|
196 | ||
197 | $this->assertTrue(AttributeModeNode::findOne(5)->isLeaf()); |
|
198 | $this->assertFalse(AttributeModeNode::findOne(2)->isLeaf()); |
|
199 | ||
200 | $this->assertTrue(MultipleTreeNode::findOne(5)->isLeaf()); |
|
201 | $this->assertFalse(MultipleTreeNode::findOne(2)->isLeaf()); |
|
202 | } |
|
203 | ||
204 | public function testMakeRootInsert() |
|
205 | { |