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:
nate 2007-08-12 22:52:15 +00:00
parent 481fe8576c
commit a98afd7e5c

View file

@ -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() {