コード例 #1
0
ファイル: LengthTest.php プロジェクト: vituhugo/webservice
 /**
  * @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
ファイル: LengthTest.php プロジェクト: dez-php/Validation
 /**
  * @dataProvider providerForInvalidLengthNonInclusive
  */
 public function testLengthOutsideBoundsForNonInclusiveCasesReturnFalse($string, $min, $max)
 {
     $validator = new Length($min, $max, false);
     $this->assertfalse($validator->validate($string));
 }