From 65a047542e66283a3234f5fbbea783db8da338df Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 21 Jan 2009 22:34:46 +0000 Subject: [PATCH] Adding test case to disprove regression in Auth component. Closes #5961 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8008 3807eeeb-6ff5-0310-8944-8be069107fe0 --- .../libs/controller/components/auth.test.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 013f16f3716..9b1924e3bb3 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -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