Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 protected function initialize()
 {
     $this->options = InputHelper::parseOptions($this->requiredAttribute('options'));
     $this->checked = $this->optionalAttribute('checked', null);
 }