mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding Router test case for Ticket #3055
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5514 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
481fe8576c
commit
a98afd7e5c
1 changed files with 19 additions and 1 deletions
|
@ -195,10 +195,28 @@ class RouterTest extends UnitTestCase {
|
|||
'webservices' => null
|
||||
)
|
||||
));
|
||||
$this->router->testing = true;
|
||||
|
||||
$result = $this->router->url(array('page' => 3));
|
||||
$expected = '/magazine/admin/subscriptions/index/page:3';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$this->router->reload();
|
||||
Router::setRequestInfo(array(
|
||||
array(
|
||||
'pass' => array(), 'action' => 'index', 'plugin' => null, 'controller' => 'real_controller_name',
|
||||
'url' => array('url' => ''), 'bare' => 0, 'webservices' => ''
|
||||
),
|
||||
array(
|
||||
'base' => '/', 'here' => '/',
|
||||
'webroot' => '/', 'passedArgs' => array('page' => 2), 'argSeparator' => ':', 'namedArgs' => array('page' => 2),
|
||||
'webservices' => null
|
||||
)
|
||||
));
|
||||
$this->router->connect('short_controller_name/index/*', array('controller' => 'real_controller_name'));
|
||||
|
||||
$result = $this->router->url(array('controller' => 'real_controller_name', 'page' => '1'));
|
||||
$expected = '/short_controller_name/index/page:1';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
function testUrlGenerationWithExtensions() {
|
||||
|
|
Loading…
Add table
Reference in a new issue