public function testParseOptions() { $expected = array(array('value' => 1, 'text' => 'Text1'), array('value' => 2, 'text' => 'Text2')); $actual = InputHelper::parseOptions(array(1 => 'Text1', 2 => 'Text2')); $this->assertEquals($expected, $actual); $expected = array(array('value' => 1, 'text' => 'Text1'), array('value' => 2, 'text' => 'Text2')); $actual = InputHelper::parseOptions($expected); $this->assertEquals($expected, $actual); }
protected function initialize() { $this->options = InputHelper::parseOptions($this->requiredAttribute('options')); $this->checked = $this->optionalAttribute('checked', null); }