/** * @dataProvider providerForComponentException * @expectedException Respect\Validation\Exceptions\ComponentException */ public function test_invalid_constructor_parameters_should_throw_ComponentException_upon_instantiation($string, $min, $max) { $validator = new Length($min, $max); $this->assertFalse($validator->validate($string)); $this->assertFalse($validator->assert($string)); }
/** * @dataProvider providerForInvalidLengthNonInclusive */ public function testLengthOutsideBoundsForNonInclusiveCasesReturnFalse($string, $min, $max) { $validator = new Length($min, $max, false); $this->assertfalse($validator->validate($string)); }