예제 #1
0
 function createMaxLengthValidator($max_length)
 {
     require_once 'Validation/MaxLengthValidator.php';
     $validator = new MaxLengthValidator();
     $validator->setMaxLength($max_length);
     return $validator;
 }
예제 #2
0
 public function testValidateEmptyValue()
 {
     $val = new MaxLengthValidator(5);
     $this->assertTrue($val->validate(''));
     $this->assertTrue($val->validate(null));
 }