/** * @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)); }
/** * @dataProvider providerAdditionalChars */ public function testAdditionalCharsShouldBeRespected($additional, $query) { $validator = new Alnum($additional); $this->assertTrue($validator->validate($query)); }
/** * @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)); }