lithium\tests\cases\util\collection\FiltersTest::testLazyApply PHP Method

testLazyApply() public method

public testLazyApply ( )
    public function testLazyApply()
    {
        $class = 'lithium\\tests\\mocks\\util\\MockFilters';
        Filters::apply($class, 'filteredMethod', function ($self, $params, $chain) {
            return md5($chain->next($self, $params, $chain));
        });
        $expected = md5('Working?');
        $result = $class::filteredMethod();
        $this->assertEqual($expected, $result);
        Filters::apply($class, 'filteredMethod', function ($self, $params, $chain) {
            return sha1($chain->next($self, $params, $chain));
        });
        $expected = md5(sha1('Working?'));
        $result = $class::filteredMethod();
        $this->assertEqual($expected, $result);
    }