/** * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException */ public function testClosureShouldReturnArray() { $closure = function () { return 'foobar'; }; $list = new ArrayChoiceList($closure); $list->getChoices(); }
/** * {@inheritdoc} */ public function getChoices() { $choices = parent::getChoices(); $array = array(); foreach ($choices as $value => $label) { $array[] = array('value' => $value, 'label' => $label); } return $array; }