From 3acebbcecb78f663988cb9ec7f88c20c7c4844b4 Mon Sep 17 00:00:00 2001 From: gwoo Date: Fri, 1 Jun 2007 17:27:10 +0000 Subject: [PATCH] adding pass to the default set of router params git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5227 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/router.php | 2 +- cake/tests/cases/libs/router.test.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index e122d497c..5ea3d13da 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -246,7 +246,7 @@ class Router extends Object { function parse($url) { $_this =& Router::getInstance(); $_this->__connectDefaultRoutes(); - $out = array(); + $out = array('pass'=>array()); $r = $ext = null; if ($url && strpos($url, '/') !== 0) { diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index cd404dccd..f47a888be 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -228,7 +228,7 @@ class RouterTest extends UnitTestCase { $this->router->parseExtensions(); $result = $this->router->parse('/posts.rss'); - $expected = array('controller' => 'posts', 'action' => null, 'url' => array ('ext' => 'rss')); + $expected = array('controller' => 'posts', 'action' => null, 'url' => array ('ext' => 'rss'), 'pass'=> array()); $this->assertEqual($result, $expected); $result = $this->router->parse('/posts/view/1.rss'); @@ -246,11 +246,11 @@ class RouterTest extends UnitTestCase { $this->router->parseExtensions('rss', 'xml'); $result = $this->router->parse('/posts.xml'); - $expected = array('controller' => 'posts', 'action' => null, 'url' => array ('ext' => 'xml')); + $expected = array('controller' => 'posts', 'action' => null, 'url' => array ('ext' => 'xml'), 'pass'=> array()); $this->assertEqual($result, $expected); $result = $this->router->parse('/posts.atom?hello=goodbye'); - $expected = array('controller' => 'posts.atom', 'action' => null); + $expected = array('controller' => 'posts.atom', 'action' => null, 'pass'=> array()); $this->assertEqual($result, $expected); $this->router->reload();