Browse Source

Adding another test and reverting teporal change

Jose Lorenzo Rodriguez 12 years ago
parent
commit
d0f461abc5

+ 1 - 1
tests/Fixture/CategoryFixture.php

@@ -43,7 +43,7 @@ class CategoryFixture extends TestFixture {
  *
  * @var array
  */
-	public $_records = array(
+	public $records = array(
 		array('parent_id' => 0, 'name' => 'Category 1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'),
 		array('parent_id' => 1, 'name' => 'Category 1.1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'),
 		array('parent_id' => 1, 'name' => 'Category 1.2', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'),

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

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