public function testSort() { $root = new RootNode(); $parent = $this->createParentNode(); $root->append($parent); $children = []; for ($i = 0; $i <= 21; $i++) { $children[] = $this->createNode(); } $parent->append($children); $collection = new NodeCollection($children, TRUE); foreach ($collection as $k => $child) { $this->assertSame($children[$k], $child); } }