adding router test, closes #3425

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5835 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-10-21 21:51:40 +00:00
parent c8b6269a64
commit acdeadde01

View file

@ -609,6 +609,24 @@ class RouterTest extends UnitTestCase {
$result = $this->router->parse('admin/users/view/'); $result = $this->router->parse('admin/users/view/');
$expected = array('pass' => array(), 'controller' => 'users', 'action' => 'view', 'plugin' => null, 'prefix' => 'admin', 'admin' => true); $expected = array('pass' => array(), 'controller' => 'users', 'action' => 'view', 'plugin' => null, 'prefix' => 'admin', 'admin' => true);
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
Configure::write('Routing.admin', 'beheer');
$this->router->reload();
$this->router->setRequestInfo(array(
array('beheer' => true, 'controller' => 'posts', 'action' => 'index', 'form' => array(), 'url' => array(), 'bare' => 0, 'webservices' => null, 'plugin' => null),
array('base' => '/', 'here' => '/beheer/posts/index', 'webroot' => '/', 'passedArgs' => array(), 'argSeparator' => ':', 'namedArgs' => array(), 'webservices' => null)
));
$result = $this->router->parse('beheer/users/view/');
$expected = array('pass' => array(), 'controller' => 'users', 'action' => 'view', 'plugin' => null, 'prefix' => 'beheer', 'beheer' => true);
$this->assertEqual($result, $expected);
$result = $this->router->url(array('controller' => 'posts', 'action' => 'index', '0', '?' => 'var=test&var2=test2'));
$expected = '/beheer/posts/index/0?var=test&var2=test2';
$this->assertEqual($result, $expected);
} }
function testExtensionParsingSetting() { function testExtensionParsingSetting() {