/** * @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)); }
/** * @expectedException Respect\Validation\Exceptions\InException * @expectedExceptionMessage "x" must be in { "foo", "bar" } */ public function testInCheckExceptionMessageWithArray() { $v = new In(array('foo', 'bar')); $v->assert('x'); }
/** * @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)); }