コード例 #1
0
ファイル: RadioList.class.php プロジェクト: theratg/miao
 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;
     }
 }
コード例 #2
0
ファイル: Radio.class.Test.php プロジェクト: theratg/miao
 /**
  * @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);
 }