22f5d31e7940ad94569241fecc61427b0ae3a14d

Author: Ali Farhadi

Date: 2009-08-20 08:03:52 +0430

Adding testcase for bug #44

diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index cf2dd22..3e58f0a 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -693,6 +693,20 @@ class RouterTest extends CakeTestCase { )); $expected = '/admin/shows/show_tickets/edit/6'; $this->assertEqual($result, $expected); + + Router::reload(); + + Router::setRequestInfo(array( + array('pass' => array(), 'action' => 'admin_index', 'plugin' => null, 'controller' => 'posts', 'prefix' => 'admin', 'admin' => true, 'url' => array('url' => 'admin/posts')), + array('base' => '', 'here' => '/admin/posts', 'webroot' => '/') + )); + + Router::connect('/admin/posts/*', array('controller' => 'posts', 'action' => 'index', 'admin' => true)); + Router::parse('/'); + + $result = Router::url(array('all')); + $expected = '/admin/posts/all'; + $this->assertEqual($result, $expected); } /** * testUrlGenerationWithPrefix method