mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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:
parent
5c53fcfcb9
commit
641a48342b
1 changed files with 13 additions and 1 deletions
|
@ -823,6 +823,18 @@ class AuthTest extends CakeTestCase {
|
||||||
$expected = Router::normalize('posts/view/1');
|
$expected = Router::normalize('posts/view/1');
|
||||||
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
|
$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
|
//external authed action
|
||||||
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
|
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
|
||||||
$this->Controller->Session->del('Auth');
|
$this->Controller->Session->del('Auth');
|
||||||
|
@ -1184,4 +1196,4 @@ class AuthTest extends CakeTestCase {
|
||||||
$this->assertFalse($this->Controller->Session->read('Auth.redirect'));
|
$this->assertFalse($this->Controller->Session->read('Auth.redirect'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue