Exemplo n.º 1
0
 /**
  * @dataProvider providerTestMain
  */
 public function testMain($name, $actual, $value = '', $attributes = array(), $exceptionName = '')
 {
     if (!empty($exceptionName)) {
         $this->setExpectedException($exceptionName);
     }
     $control = new Miao_Form_Control_Text($name, $attributes);
     $control->setValue($value);
     $expected = $control->render();
     $this->assertEquals($expected, $actual);
 }
Exemplo n.º 2
0
 /**
  * @dataProvider providerTestSeveralValidator
  * @param unknown_type $value
  */
 public function testSeveralValidator($value)
 {
     $control = new Miao_Form_Control_Text('title');
     $control->setRequired('require');
     $control->addValidator(new Miao_Form_Validate_Length(5), false);
     $control->addValidator(new Miao_Form_Validate_Length(6), false);
     $control->setValue($value);
     $control->validate();
     $expected = $control->error()->__toString();
 }