DMS\Filter\Filters\CallbackTest::testRuleWithClosure PHP Method

testRuleWithClosure() public method

public testRuleWithClosure ( )
    public function testRuleWithClosure()
    {
        $closure = function ($value) {
            return 'called_back';
        };
        $this->rule->expects($this->once())->method('getInputType')->will($this->returnValue(CallbackRule::CLOSURE_TYPE));
        $this->rule->callback = $closure;
        $result = $this->filter->apply($this->rule, 'value');
        $this->assertEquals('called_back', $result);
    }