Skip to content
Permalink
Browse files

Fix Uri query string not getting set.

When the `url` option is used, the query string if present should be set
into the Uri instance. This makes it match up with the `query` property.
  • Loading branch information...
markstory committed Jan 5, 2017
1 parent 7716434 commit b07eb6837a325038130d15249358c583418b2d94
Showing with 4 additions and 0 deletions.
  1. +3 −0 src/Http/ServerRequest.php
  2. +1 −0 tests/TestCase/Network/RequestTest.php
@@ -314,6 +314,9 @@ protected function _setConfig($config)
if ($config['url']) {
$uri = $uri->withPath('/' . $config['url']);
}
if (strlen($querystr)) {
$uri = $uri->withQuery($querystr);
}
$this->uri = $uri;
$this->base = $config['base'];
@@ -172,6 +172,7 @@ public function testQueryStringParsingFromInputUrl()
$expected = ['one' => 'something', 'two' => 'else'];
$this->assertEquals($expected, $request->query);
$this->assertEquals('some/path', $request->url);
$this->assertEquals('one=something&two=else', $request->getUri()->getQuery());
}
/**

0 comments on commit b07eb68

Please sign in to comment.
You can’t perform that action at this time.