Adding test for Auth login redirect to url with query string parameters. Disproves #6211.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8118 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
jperras 2009-03-19 18:37:54 +00:00
parent 5c53fcfcb9
commit 641a48342b

View file

@ -823,6 +823,18 @@ class AuthTest extends CakeTestCase {
$expected = Router::normalize('posts/view/1');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
// QueryString parameters
$this->Controller->Session->del('Auth');
$url = '/posts/index/29?print=true&refer=menu';
$this->Controller->params = Router::parse($url);
$this->Controller->params['url']['url'] = Router::normalize($url);
$this->Controller->Auth->initialize($this->Controller);
$this->Controller->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
$this->Controller->Auth->userModel = 'AuthUser';
$this->Controller->Auth->startup($this->Controller);
$expected = Router::normalize('posts/index/29?print=true&refer=menu');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
//external authed action
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
$this->Controller->Session->del('Auth');
@ -1184,4 +1196,4 @@ class AuthTest extends CakeTestCase {
$this->assertFalse($this->Controller->Session->read('Auth.redirect'));
}
}
?>
?>