public function testSlashShouldNotBeAppendedInChildMiddlewareWhenLayerDoesNotIncludeIt()
{
$this->middleware->pipe('/admin', function ($req, $res, $next) {
return $next($req, $res);
});
$phpunit = $this;
$this->middleware->pipe(function ($req, $res, $next) use($phpunit) {
return $res->write($req->getUri()->getPath());
});
$request = new Request([], [], 'http://local.example.com/admin', 'GET', 'php://memory');
$result = $this->middleware->__invoke($request, $this->response);
$body = (string) $result->getBody();
$this->assertSame('/admin', $body);
}