public function testGetLastChild() { $this->assertSame($this->pt2, $this->menu->getLastChild()); // test for bug in getFirstChild implementation (when internal array pointer is changed getLastChild returns wrong child) foreach ($this->menu->getChildren() as $c); $this->assertSame($this->pt2, $this->menu->getLastChild()); }