public function test($value) { return preg_match($this->option, $value) !== 0; }
public function testValidation() { $regex = new RegexType('#^Test$#'); ok($regex->test('Test')); $this->assertFalse($regex->test('test')); $regex->option = '/^([a-z]+)$/'; ok($regex->test('barfoo')); $this->assertFalse($regex->test('foobar234')); }