Skip to content
Permalink
Browse files

Fixing issues in tests that caused group test to fail, and removing d…

…uplicate environment backup.
  • Loading branch information...
markstory committed Sep 20, 2010
1 parent d64bd2a commit 973841a264a98fc385272676533af363407b1835
Showing with 2 additions and 8 deletions.
  1. +2 −8 cake/tests/cases/libs/controller/components/auth.test.php
@@ -957,10 +957,6 @@ function testAllowedActionsSetWithAllowMethod() {
* @return void
*/
function testLoginRedirect() {
$backup = null;
if (isset($_SERVER['HTTP_REFERER'])) {
$backup = $_SERVER['HTTP_REFERER'];
}
$_SERVER['HTTP_REFERER'] = false;
$_ENV['HTTP_REFERER'] = false;
putenv('HTTP_REFERER=');
@@ -1019,13 +1015,12 @@ function testLoginRedirect() {
$expected = Router::normalize('/');
$this->assertEqual($expected, $this->Controller->testUrl);
$this->Controller->Session->delete('Auth');
$_SERVER['HTTP_REFERER'] = Router::url('/admin', true);
$_SERVER['HTTP_REFERER'] = $_ENV['HTTP_REFERER'] = Router::url('/admin', true);
$this->Controller->Session->write('Auth', array(
'AuthUser' => array('id'=>'1', 'username' => 'nate')
));
$this->Controller->request->params['action'] = 'login';
$this->Controller->request->query['url'] = 'auth_test/login';
$this->Controller->Auth->initialize($this->Controller);
$this->Controller->Auth->loginAction = 'auth_test/login';
@@ -1126,7 +1121,6 @@ function testLoginRedirect() {
$expected = Router::normalize('/');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
$_SERVER['HTTP_REFERER'] = $backup;
$this->Controller->Session->delete('Auth');
}

0 comments on commit 973841a

Please sign in to comment.
You can’t perform that action at this time.