function testGetById() { $menu = new OA_Admin_Menu(); $sections = $this->generateSections(10, 1); //test get by non existent id $child = $menu->get(null); $this->assertNull($child); $child = $menu->get('some-nonexistent-child-id'); $this->assertNull($child); //test get by id for ($i = 0; $i < count($sections); $i++) { $menu->add($sections[$i]); } $this->assertEqual(count($sections), count($menu->getRootSections())); for ($i = 0; $i < count($sections); $i++) { $child = $menu->get($sections[$i]->getId()); $this->assertNotNull($child); $this->assertSectionsEqual($child, $sections[$i]); } }