Example #1
0
 public function testString()
 {
     $expect = array('1', 'true', 't', '1', '42', '10', 'yes', '1,1', '', 'false', 'f', '0', 'This text is false', '', '', '', 'string', '', 'no', '<script>alert();</script>', '*****@*****.**', '*****@*****.**', 'http://testing.co', 'http://testing.co', '01/01/1970', '31/12/1970', '12/31/1970', '10/10/70', '127.0.0.1', '255.255.255.255', '2001:0db8:0000:0000:0000:ff00:0042:8329');
     foreach ($this->tests as $index => $value) {
         $this->assertSame($expect[$index], Filter::string($value), "Test index: {$index}");
     }
     $this->assertSame($expect, call_user_func_array('\\Filter\\Filter::string', $this->tests));
 }