示例#1
0
 /**
  * @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));
 }
示例#2
0
 /**
  * @dataProvider providerForInvalidLengthNonInclusive
  */
 public function testLengthOutsideBoundsForNonInclusiveCasesReturnFalse($string, $min, $max)
 {
     $validator = new Length($min, $max, false);
     $this->assertfalse($validator->validate($string));
 }