Fix loss of query params in Router and unit test

This commit is contained in:
Chris Boden 2014-09-13 19:14:18 -04:00
parent dbb9905842
commit 1a47d4f5e4
2 changed files with 12 additions and 0 deletions

View File

@ -53,6 +53,8 @@ class Router implements HttpServerInterface {
$parameters[$key] = $value;
}
}
$parameters = array_merge($parameters, $request->getQuery()->getAll());
$url = Url::factory($request->getPath());
$url->setQuery($parameters);
$request->setUrl($url);

View File

@ -15,8 +15,18 @@ class RouterTest extends \PHPUnit_Framework_TestCase {
protected $_req;
public function setUp() {
$queryMock = $this->getMock('Guzzle\Http\QueryString');
$queryMock
->expects($this->any())
->method('getAll')
->will($this->returnValue(array()));
$this->_conn = $this->getMock('\Ratchet\ConnectionInterface');
$this->_req = $this->getMock('\Guzzle\Http\Message\RequestInterface');
$this->_req
->expects($this->any())
->method('getQuery')
->will($this->returnValue($queryMock));
$this->_matcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface');
$this->_matcher
->expects($this->any())