diff --git a/tests/model/HierarchyTest.php b/tests/model/HierarchyTest.php index 891263750..f7d63be5a 100644 --- a/tests/model/HierarchyTest.php +++ b/tests/model/HierarchyTest.php @@ -88,5 +88,15 @@ class HierarchyTest extends SapphireTest { 'numChildren() caching can be disabled by flushCache()' ); } - -} + + function testLoadDescendantIDListInto() { + $page2 = $this->objFromFixture('Page', 'page2'); + $idList = $page2->getDescendantIDList(); + $page2a = $this->objFromFixture('Page', 'page2a'); + $page2b = $this->objFromFixture('Page', 'page2b'); + $this->assertContains($page2a->ID, $idList, 'Page 2a is a descendant of Page 2'); + $this->assertContains($page2b->ID, $idList, 'Page 2b is a descendant of Page 2'); + $this->assertEquals(2, count($idList), 'There are 2 descendants of Page 2'); + } + +} \ No newline at end of file