Exemplo n.º 1
0
 function validate($value, $valueIdentifier = null)
 {
     parent::validate($value, $valueIdentifier);
     $this->success = !$this->success;
     return $this->success;
 }
Exemplo n.º 2
0
 /**
  * @expectedException Respect\Validation\Exceptions\RegexException
  */
 public function testRegexNot()
 {
     $v = new Regex('/^w+$/');
     $this->assertFalse($v->validate('w poiur'));
     $this->assertFalse($v->assert('w poiur'));
 }
Exemplo n.º 3
0
 /**
  * @dataProvider provideTestFilter
  */
 public function testFilter($options, $raw, $filtered, $valid)
 {
     $int = new Regex($options);
     $this->assertEquals($filtered, $int->filter($raw));
     $this->assertEquals($valid, $int->validate($raw));
 }