Example #1
0
 /**
  * Tests integers
  *
  * @author Nikos Dimopoulos <*****@*****.**>
  * @since  2012-11-30
  *
  * @param string $filter
  * @param mixed  $expected
  * @param mixed  $value
  */
 protected function sanitizer($filter, $expected, $value)
 {
     $fl = new Filter();
     $actual = $fl->sanitize($value, $filter);
     expect($expected)->equals($actual);
 }
Example #2
0
 /**
  * Tests a custom callable filter
  *
  * @author Serghei Iakovlev <*****@*****.**>
  * @since  2016-04-15
  * @issue  11581
  */
 public function testSanitizeCustomCallableFilterIp()
 {
     $this->specify("callable filter does not return correct IP", function () {
         $filter = new Filter();
         $filter->add('ipv4', [$this, 'ipv4callback']);
         expect($filter->sanitize('127.0.0.1', 'ipv4'))->equals('127.0.0.1');
     });
 }