From acf293b3c62549e0621ea2897f8eef5d5372c370 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Wed, 19 Mar 2014 21:53:07 +0100 Subject: [PATCH] Agging another test for a tree with another root --- tests/Fixture/NumberTreeFixture.php | 7 +++++++ tests/TestCase/Model/Behavior/TreeBehaviorTest.php | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/tests/Fixture/NumberTreeFixture.php b/tests/Fixture/NumberTreeFixture.php index 2e6b02fb310..2c1aaa876dd 100644 --- a/tests/Fixture/NumberTreeFixture.php +++ b/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' ) ); diff --git a/tests/TestCase/Model/Behavior/TreeBehaviorTest.php b/tests/TestCase/Model/Behavior/TreeBehaviorTest.php index 076356705f7..fc378b8cbad 100644 --- a/tests/TestCase/Model/Behavior/TreeBehaviorTest.php +++ b/tests/TestCase/Model/Behavior/TreeBehaviorTest.php @@ -62,6 +62,10 @@ public function testFindPath() { $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()); } + }