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
This commit is contained in:
gwoo 2007-06-01 17:27:10 +00:00
parent c58a7e95b9
commit 3acebbcecb
2 changed files with 4 additions and 4 deletions

View file

@ -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) {

View file

@ -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();