ZendTest\Stratigility\MiddlewarePipeTest::testMiddlewareTreatsBothSlashAndEmptyPathAsTheRootPath PHP Метод

testMiddlewareTreatsBothSlashAndEmptyPathAsTheRootPath() публичный Метод

    public function testMiddlewareTreatsBothSlashAndEmptyPathAsTheRootPath($path)
    {
        $middleware = $this->middleware;
        $middleware->pipe($path, function ($req, $res) {
            return $res->withHeader('X-Found', 'true');
        });
        $uri = (new Uri())->withPath($path);
        $request = (new Request())->withUri($uri);
        $response = $middleware($request, $this->response, $this->createFinalHandler());
        $this->assertTrue($response->hasHeader('x-found'));
    }
MiddlewarePipeTest