Making sure default extension is always set when Router::parseExtensions() is used

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6507 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2008-03-03 23:56:18 +00:00
parent 017afa637d
commit 12466ebe43
2 changed files with 4 additions and 1 deletions

View file

@ -502,6 +502,9 @@ class Router extends Object {
}
}
}
if (empty($ext)) {
$ext = 'html';
}
}
return compact('ext', 'url');
}

View file

@ -766,7 +766,7 @@ class RouterTest extends UnitTestCase {
$this->assertEqual($result, $expected);
$result = $this->router->parse('/posts.atom?hello=goodbye');
$expected = array('plugin' => null, 'controller' => 'posts.atom', 'action' => 'index', 'pass' => array(), 'named' => array());
$expected = array('plugin' => null, 'controller' => 'posts.atom', 'action' => 'index', 'pass' => array(), 'named' => array(), 'url' => array('ext' => 'html'));
$this->assertEqual($result, $expected);
$this->router->reload();