mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing issues in tests that caused group test to fail, and removing duplicate environment backup.
This commit is contained in:
parent
d64bd2a82c
commit
973841a264
1 changed files with 2 additions and 8 deletions
|
@ -957,10 +957,6 @@ class AuthTest extends CakeTestCase {
|
|||
* @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 @@ class AuthTest extends CakeTestCase {
|
|||
$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 @@ class AuthTest extends CakeTestCase {
|
|||
$expected = Router::normalize('/');
|
||||
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
|
||||
|
||||
$_SERVER['HTTP_REFERER'] = $backup;
|
||||
$this->Controller->Session->delete('Auth');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue