Example #1
0
 /**
  * @dataProvider providerForNotIn
  * @expectedException Respect\Validation\Exceptions\InException
  */
 public function testInvalidInChecksShouldThrowInException($input, $options, $strict = false)
 {
     $v = new In($options, $strict);
     $this->assertFalse($v->__invoke($input));
     $this->assertFalse($v->assert($input));
 }
Example #2
0
 /**
  * @expectedException Respect\Validation\Exceptions\InException
  * @expectedExceptionMessage "x" must be in { "foo", "bar" }
  */
 public function testInCheckExceptionMessageWithArray()
 {
     $v = new In(array('foo', 'bar'));
     $v->assert('x');
 }
Example #3
0
 /**
  * @dataProvider providerForNotIn
  * @expectedException Respect\Validation\Exceptions\InException
  */
 public function test_invalid_in_checks_should_throw_InException($input, $options, $strict = false)
 {
     $v = new In($options, $strict);
     $this->assertFalse($v->validate($input));
     $this->assertFalse($v->assert($input));
 }