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; } }
/** * @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); }