Skip to content

Commit

Permalink
Adding test case to disprove regression in Auth component. Closes #5961
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8008 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
markstory committed Jan 21, 2009
1 parent dcf1c1e commit 65a0475
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cake/tests/cases/libs/controller/components/auth.test.php
Expand Up @@ -962,6 +962,25 @@ function testCustomRoute() {
$this->Controller->Auth->startup($this->Controller);
$user = $this->Controller->Auth->user();
$this->assertTrue(!!$user);

Router::reload();
Router::connect('/', array('controller' => 'people', 'action' => 'login'));
$url = '/';
$this->Controller->params = Router::parse($url);
Router::setRequestInfo(array($this->Controller->passedArgs, array(
'base' => null, 'here' => $url, 'webroot' => '/', 'passedArgs' => array(),
'argSeparator' => ':', 'namedArgs' => array()
)));

$this->Controller->data['AuthUser'] = array('username' => 'felix', 'password' => 'cake');
$this->Controller->params['url']['url'] = substr($url, 1);
$this->Controller->Auth->initialize($this->Controller);
$this->Controller->Auth->loginAction = array('controller' => 'people', 'action' => 'login');
$this->Controller->Auth->userModel = 'AuthUser';

$this->Controller->Auth->startup($this->Controller);
$user = $this->Controller->Auth->user();
$this->assertTrue(!!$user);
}
/**
* testAdminRoute method
Expand Down

0 comments on commit 65a0475

Please sign in to comment.