public function testFind() { $root = new RootNode(); $parent_one = $this->createParentNode(); $one = $this->createNode(); $parent_one->append($one); $root->append($parent_one); $parent_two = $this->createParentNode(); $two = $this->createNode(); $parent_two->append($two); $root->append($parent_two); $collection = new NodeCollection([$parent_one, $parent_two]); $matches = $collection->find(function () { return TRUE; }); $this->assertCount(2, $matches); $this->assertSame($one, $matches[0]); $this->assertSame($two, $matches[1]); }