예제 #1
0
 /**
  * @dataProvider provideTestFilter
  */
 public function testFilter($options, $raw, $filtered, $valid)
 {
     $int = new Alnum($options);
     $this->assertEquals($filtered, $int->filter($raw));
     $this->assertEquals($valid, $int->validate($raw));
 }
예제 #2
0
 /**
  * @dataProvider providerAdditionalChars
  */
 public function testAdditionalCharsShouldBeRespected($additional, $query)
 {
     $validator = new Alnum($additional);
     $this->assertTrue($validator->validate($query));
 }
예제 #3
0
 /**
  * @dataProvider providerForInvalidAlnum
  * @expectedException Respect\Validation\Exceptions\AlnumException
  */
 public function test_invalid_alnum_chars_should_throw_AlnumException_and_return_false($invalidAlnum, $aditional)
 {
     $validator = new Alnum($aditional);
     $this->assertFalse($validator->validate($invalidAlnum));
     $this->assertFalse($validator->assert($invalidAlnum));
 }