Skip to content

Commit 12457ac

Browse files
farhadimarkstory
authored andcommitted
Adding testcase for bug #44
1 parent 4f44111 commit 12457ac

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cake/tests/cases/libs/router.test.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,20 @@ function testUrlGeneration() {
693693
));
694694
$expected = '/admin/shows/show_tickets/edit/6';
695695
$this->assertEqual($result, $expected);
696+
697+
Router::reload();
698+
699+
Router::setRequestInfo(array(
700+
array('pass' => array(), 'action' => 'admin_index', 'plugin' => null, 'controller' => 'posts', 'prefix' => 'admin', 'admin' => true, 'url' => array('url' => 'admin/posts')),
701+
array('base' => '', 'here' => '/admin/posts', 'webroot' => '/')
702+
));
703+
704+
Router::connect('/admin/posts/*', array('controller' => 'posts', 'action' => 'index', 'admin' => true));
705+
Router::parse('/');
706+
707+
$result = Router::url(array('all'));
708+
$expected = '/admin/posts/all';
709+
$this->assertEqual($result, $expected);
696710
}
697711
/**
698712
* testUrlGenerationWithPrefix method

0 commit comments

Comments
 (0)