public function testFromArrayWithChildrenOmittingName() { $factory = new MenuFactory(); $array = array('name' => 'joe', 'children' => array('jack' => array('label' => 'Jack'), 'john' => array('label' => 'John'))); $item = $factory->createFromArray($array); $this->assertEquals('joe', $item->getName()); $this->assertEmpty($item->getAttributes()); $this->assertCount(2, $item); $this->assertTrue(isset($item['john'])); $this->assertTrue(isset($item['jack'])); }