Ejemplo n.º 1
0
 public function setItems(array $items)
 {
     foreach ($items as $key => $value) {
         $control = new Miao_Form_Control_Radio($this->getName(), $this->getAttributes());
         $control->setValue($key);
         $control->setLabel($value);
         $this->_items[] = $control;
     }
 }
Ejemplo n.º 2
0
 /**
  * @dataProvider providerTestMain
  */
 public function testMain($name, $actual, $value = '', $attributes = array(), $exceptionName = '')
 {
     if (!empty($exceptionName)) {
         $this->setExpectedException($exceptionName);
     }
     $control = new Miao_Form_Control_Radio($name, $attributes);
     $control->setValue($value);
     $expected = $control->render();
     $this->assertEquals($expected, $actual);
 }