Beispiel #1
0
 public function filter($var)
 {
     $var = parent::filter($var);
     if (!preg_match($this->options['regex'], $var)) {
         return null;
     }
     return $var;
 }
Beispiel #2
0
 /**
  * @dataProvider provideTestFilter
  */
 public function testFilter($options, $raw, $filtered, $valid)
 {
     $int = new Strings($options);
     $this->assertEquals($filtered, $int->filter($raw));
     $this->assertEquals($valid, $int->validate($raw));
 }