Commit: 608853573db399643f56c41cf2765657f03e8c16

Author: Joël Perras | Date: 2010-08-28 16:38:14 -0400
Adding test to `net\http\RouterTest` to disprove #149.
diff --git a/libraries/lithium/tests/cases/net/http/RouterTest.php b/libraries/lithium/tests/cases/net/http/RouterTest.php index 61dc1f9..c0a68b4 100644 --- a/libraries/lithium/tests/cases/net/http/RouterTest.php +++ b/libraries/lithium/tests/cases/net/http/RouterTest.php @@ -185,6 +185,19 @@ class RouterTest extends \lithium\test\Unit { $this->assertEqual('/users/view/47#blargh', $result); } + public function testQueryString() { + Router::connect('/{:controller}/{:action}'); + Router::connect('/{:controller}/{:action}/{:id:[0-9]+}', array('id' => null)); + + $result = Router::match(array('Posts::edit', '?' => array('key' => 'value'))); + $this->assertEqual('/posts/edit?key=value', $result); + + $result = Router::match(array( + 'Posts::edit', 'id' => 42, '?' => array('key' => 'value', 'test' => 'foo') + )); + $this->assertEqual('/posts/edit/42?key=value&test=foo', $result); + } + /** * Tests that URLs specified as "Controller::action" and including additional parameters are * interpreted properly.