mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-27 21:15:40 +02:00
MINOR Added test case for Hierarchy::getDescendantIDList() which also tests Hierarchy::loadDescendantIDListInto()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98369 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cb4ec2b3d2
commit
be919f2898
@ -89,4 +89,14 @@ class HierarchyTest extends SapphireTest {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user