From 319e622151669ad2bfe0f6ec27629bd21073229c Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 18 Dec 2010 16:51:54 -0500 Subject: [PATCH] Added another test for querystring params. Querystring params should not be affected by greedy routes, as they are not really controlled by internal routing. --- cake/tests/cases/libs/route/cake_route.test.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cake/tests/cases/libs/route/cake_route.test.php b/cake/tests/cases/libs/route/cake_route.test.php index 5e6860fba..3107e0084 100644 --- a/cake/tests/cases/libs/route/cake_route.test.php +++ b/cake/tests/cases/libs/route/cake_route.test.php @@ -496,4 +496,16 @@ class CakeRouteTestCase extends CakeTestCase { $expected = '/posts/index/?test=value&other=value'; $this->assertEquals($expected, $result); } + +/** + * test that querystring params work with non greedy routes. + * + * @return void + */ + function testQueryStringNonGreedy() { + $route = new CakeRoute('/:controller/:action'); + $result = $route->match(array('controller' => 'posts', 'action' => 'index', '?test' => 'value')); + $expected = '/posts/index?test=value'; + $this->assertEquals($expected, $result); + } } \ No newline at end of file