Adding Router test case for Ticket #3028

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5524 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-08-15 14:28:53 +00:00
parent ad75ecea81
commit 32e61a8adf

View file

@ -39,11 +39,6 @@ if (!defined('CAKE_ADMIN')) {
*/
class RouterTest extends UnitTestCase {
function RouterTest() {
parent::UnitTestCase();
$this->startTime = getMicrotime();
}
function setUp() {
$this->router =& Router::getInstance();
//$this->router->reload();
@ -355,6 +350,11 @@ class RouterTest extends UnitTestCase {
$result = $this->router->parse('pages/display/home');
$this->assertEqual($result, $expected);
$this->router->reload();
$this->router->connect('/page/*', array('controller' => 'test'));
$result = $this->router->parse('/page/my-page');
$expected = array('pass' => array('my-page'), 'plugin' => null, 'controller' => 'test', 'action' => 'index');
}
function testAdminRouting() {
@ -464,10 +464,6 @@ class RouterTest extends UnitTestCase {
$expected = array('pass'=>array('contact'), 'plugin'=> null, 'controller'=>'pages', 'action'=>'display');
$this->assertEqual($result, $expected);
}
function testEnd() {
pr(round(getMicrotime() - $this->startTime, 5));
}
}
?>