Browse Source

Agging another test for a tree with another root

Jose Lorenzo Rodriguez 12 years ago
parent
commit
acf293b3c6

+ 7 - 0
tests/Fixture/NumberTreeFixture.php

@@ -117,6 +117,13 @@ class NumberTreeFixture extends TestFixture {
 			'parent_id' => '6',
 			'lft' => '17',
 			'rght' => '18'
+		),
+		array(
+			'id' => '11',
+			'name' => 'alien hardware',
+			'parent_id' => null,
+			'lft' => '21',
+			'rght' => '21'
 		)
 	);
 

+ 4 - 0
tests/TestCase/Model/Behavior/TreeBehaviorTest.php

@@ -62,6 +62,10 @@ class TreeBehaviorTest extends TestCase {
 
 		$nodes = $this->table->find('path', ['for' => 1]);
 		$this->assertEquals([1], $nodes->extract('id')->toArray());
+
+		$nodes = $this->table->find('path', ['for' => 11]);
+		$this->assertEquals([11], $nodes->extract('id')->toArray());
 	}
 
+
 }