public function testValidatorShouldPassWithOnlyKeyValidation()
 {
     $v = new Each(null, new IntVal());
     $result = $v->validate(array('a', 'b', 'c', 'd', 'e'));
     $this->assertTrue($result);
     $result = $v->check(array('a', 'b', 'c', 'd', 'e'));
     $this->assertTrue($result);
     $result = $v->assert(array('a', 'b', 'c', 'd', 'e'));
     $this->assertTrue($result);
 }
Exemple #2
0
 public function test_validator_should_pass_with_only_key_validation()
 {
     $v = new Each(null, new Int());
     $result = $v->validate(array('a', 'b', 'c', 'd', 'e'));
     $this->assertTrue($result);
     $result = $v->check(array('a', 'b', 'c', 'd', 'e'));
     $this->assertTrue($result);
     $result = $v->assert(array('a', 'b', 'c', 'd', 'e'));
     $this->assertTrue($result);
 }
Exemple #3
0
 /**
  * @expectedException Respect\Validation\Exceptions\EachException
  */
 public function testCheckShouldFailWithNonIterableInput()
 {
     $v = new Each($this->getRuleMock(false));
     $v->check(null);
 }