public function testCreateChoiceListWithGroupedChoices() { $choiceList = new ArrayChoiceList(array('Group 1' => array('A' => 'a', 'B' => 'b'), 'Group 2' => array('C' => 'c', 'D' => 'd'))); $this->assertSame(array('0', '1', '2', '3'), $choiceList->getValues()); $this->assertSame(array('Group 1' => array('A' => '0', 'B' => '1'), 'Group 2' => array('C' => '2', 'D' => '3')), $choiceList->getStructuredValues()); $this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd'), $choiceList->getChoices()); $this->assertSame(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D'), $choiceList->getOriginalKeys()); $this->assertSame(array(1 => 'a', 2 => 'b'), $choiceList->getChoicesForValues(array(1 => '0', 2 => '1'))); $this->assertSame(array(1 => '0', 2 => '1'), $choiceList->getValuesForChoices(array(1 => 'a', 2 => 'b'))); }