mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 04:26:20 +00:00
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
This commit is contained in:
parent
871817e6fe
commit
2ff0e4f54f
1 changed files with 21 additions and 1 deletions
|
@ -347,7 +347,27 @@ class RouterTest extends UnitTestCase {
|
||||||
$expected = '/kalender/10/2007/min-forestilling';
|
$expected = '/kalender/10/2007/min-forestilling';
|
||||||
$this->assertEqual($result, $expected);
|
$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() {
|
function testUrlGenerationWithExtensions() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue