lithium\tests\cases\action\RequestTest::testDetectWithClosure PHP Method

testDetectWithClosure() public method

    public function testDetectWithClosure()
    {
        $request = new Request();
        $request->detect('cool', function ($self) {
            return true;
        });
        $request->detect('notCool', function ($self) {
            return false;
        });
        $this->assertTrue($request->is('cool'));
        $this->assertFalse($request->is('notCool'));
    }
RequestTest