Phalcon\Test\Unit\Filter\FilterCustomTest::testSanitizeCustomCallableFilterIp PHP 메소드

testSanitizeCustomCallableFilterIp() 공개 메소드

Tests a custom callable filter
부터: 2016-04-15
저자: Serghei Iakovlev ([email protected])
    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');
        });
    }