예제 #1
0
 public function validate($input)
 {
     if (!$this->isArray($input)) {
         throw new InvalidInputException("The input must be an array");
     }
     if (!$this->keyExists($this->key, $input)) {
         throw new InvalidInputException("The key does not exists");
     }
     return v::notEmpty()->validate($input[$this->key]);
 }
예제 #2
0
 /**
  * @dataProvider providerForEmpty
  */
 public function testInvalidStringShouldFailValidation($input)
 {
     $this->assertFalse(v::notEmpty()->validate($input));
 }