public function getRawUri()
{
$query = $this->server->get('QUERY_STRING');
if (!empty($query)) {
$query = '?' . urldecode($query);
}
return $this->getSchemeAndHttpHost() . $this->getBaseUrl() . $this->getPathInfo() . $query;
}
/** * @dataProvider getQueryStrings */ public function testGetRawUriDecodesUri($queryString, $expectedQueryString) { $request = new Request([], [], [], [], [], ['SERVER_NAME' => 'imbo', 'SERVER_PORT' => 80, 'QUERY_STRING' => $queryString]); $uri = $request->getRawUri(); $this->assertSame($expectedQueryString, substr($uri, strpos($uri, '?') + 1)); }