ZendTest\Stratigility\NextTest::testRequestUriInInvokedHandlerDoesNotContainMatchedPortionOfRoute PHP Method

testRequestUriInInvokedHandlerDoesNotContainMatchedPortionOfRoute() public method

    public function testRequestUriInInvokedHandlerDoesNotContainMatchedPortionOfRoute()
    {
        // e.g., if route is "/foo", and "/foo/bar" is the original path,
        // then the URI path in the handler is "/bar"
        $triggered = null;
        $route = new Route('/foo', function ($req, $res, $next) use(&$triggered) {
            $triggered = $req->getUri()->getPath();
        });
        $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/bar'));
        $next = new Next($this->queue, $done);
        $next($request, $this->response);
        $this->assertEquals('/bar', $triggered);
    }
NextTest