$strToLower =
function D
$arr) { foreach ($arr as $key =>
$value) { yield strtolower($key) =>
$value;
} };
$this->
assertEquals($request->
getAttributes(),
$finalRequest->
getAttributes());
$this->
assertEquals($request->
getCookieParams(),
$finalRequest->
getCookieParams());
$this->
assertEquals((array) $request->
getParsedBody(),
(array) $finalRequest->
getParsedBody());
$this->
assertEquals($request->
getQueryParams(),
$finalRequest->
getQueryParams());
// PSR7 does not define a "withServerParams" so this is impossible to implement without knowing the PSR7 implementation.
// $this->assertEquals($request->getServerParams(), $finalRequest->getServerParams());
$this->
assertEquals($request->
getUploadedFiles(),
$finalRequest->
getUploadedFiles());
$this->
assertEquals($request->
getMethod(),
$finalRequest->
getMethod());
$this->
assertEquals($request->
getRequestTarget(),
$finalRequest->
getRequestTarget());
$this->
assertEquals((string) $request->
getUri(),
(string) $finalRequest->
getUri());
$this->
assertEquals((string) $request->
getBody(),
(string) $finalRequest->
getBody());
$this->
assertEquals($strToLower($request->
getHeaders()),
$strToLower($finalRequest->
getHeaders()));
$this->
assertEquals($request->
getProtocolVersion(),
$finalRequest->
getProtocolVersion());
} else { $this->
fail('$finalRequest must be an instance of PSR7 or a HTTPFoundation request'
);
} }