From 2ff0e4f54f2b8598aaeb8bb4a99105fd8b4027e4 Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 21 Aug 2007 17:02:07 +0000 Subject: [PATCH] Admin routing test for Ticket #3104 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5562 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/router.test.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 068bfc34e..5894a08a5 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -347,7 +347,27 @@ class RouterTest extends UnitTestCase { $expected = '/kalender/10/2007/min-forestilling'; $this->assertEqual($result, $expected); - + Configure::write('Routing.admin', 'admin'); + $this->router->reload(); + + $this->router->setRequestInfo(array( + array( + 'pass' => array(), 'admin' => true, 'action' => 'index', 'plugin' => null, 'controller' => 'users', + 'url' => array('url' => 'users'), 'bare' => 0, 'webservices' => '' + ), + array( + 'base' => '/', 'here' => '/', + 'webroot' => '/', 'passedArgs' => array(), 'argSeparator' => ':', 'namedArgs' => array(), + 'webservices' => null + ) + )); + + $this->router->connect('/page/*', array('controller' => 'pages', 'action' => 'view', 'admin' => true, 'prefix' => 'admin')); + $this->router->parse('/'); + + $result = $this->router->url(array('admin' => true, 'controller' => 'pages', 'action' => 'view', 'my-page')); + $expected = '/page/my-page'; + $this->assertEqual($result, $expected); } function testUrlGenerationWithExtensions() {