예제 #1
0
파일: OrTest.php 프로젝트: bergelmir/Idun
 /**
  * test isValid() with invalid value
  */
 public function testIsNotValid()
 {
     $validator = new Idun_Validate_Or(array(new Zend_Validate_Int(), new Zend_Validate_Float()));
     $this->assertFalse($validator->isValid('invalid'));
     $messages = $validator->getMessages();
     $this->assertArrayHasKey(Zend_Validate_Int::NOT_INT, $messages);
     $this->assertArrayHasKey(Zend_Validate_Float::NOT_FLOAT, $messages);
 }
예제 #2
0
파일: Nor.php 프로젝트: bergelmir/Idun
 /**
  * @access public
  * @param  mixed $value
  * @return boolean
  */
 public function isValid($value)
 {
     if (!parent::isValid($value)) {
         $this->_messages = array();
         $this->_errors = array();
         return true;
     }
     $this->_error(self::ONE_OR_MORE_CONDITIONS_TRUE);
     return false;
 }