ZendTest\Stratigility\NextTest::testInvokesHandlerWhenMatched PHP Method

testInvokesHandlerWhenMatched() public method

    public function testInvokesHandlerWhenMatched()
    {
        // e.g., if route is "/foo", but path is "/foobar", no match
        $triggered = null;
        $route = new Route('/foo', function ($req, $res, $next) use(&$triggered) {
            $triggered = true;
        });
        $this->queue->enqueue($route);
        $done = function ($req, $res, $err = null) {
            $this->fail('Should not hit done handler');
        };
        $request = $this->request->withUri(new Uri('http://local.example.com/foo'));
        $next = new Next($this->queue, $done);
        $next($request, $this->response);
        $this->assertTrue($triggered);
    }
NextTest