Skip to content

Commit a839c29

Browse files
committed
Fixing use of deprecated methods in Auth test.
1 parent 37b5754 commit a839c29

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

cake/tests/cases/libs/controller/components/auth.test.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ function startTest() {
498498

499499
ClassRegistry::addObject('view', new View($this->Controller));
500500

501-
$this->Controller->Session->del('Auth');
502-
$this->Controller->Session->del('Message.auth');
501+
$this->Controller->Session->delete('Auth');
502+
$this->Controller->Session->delete('Message.auth');
503503

504504
Router::reload();
505505

@@ -517,8 +517,8 @@ function endTest() {
517517
$_ENV = $this->_env;
518518
Configure::write('Acl', $this->_acl);
519519
Configure::write('Security.salt', $this->_securitySalt);
520-
$this->Controller->Session->del('Auth');
521-
$this->Controller->Session->del('Message.auth');
520+
$this->Controller->Session->delete('Auth');
521+
$this->Controller->Session->delete('Message.auth');
522522
ClassRegistry::flush();
523523
unset($this->Controller, $this->AuthUser);
524524
}
@@ -586,7 +586,7 @@ function testLogin() {
586586
'id' => 1, 'username' => 'mariano', 'created' => '2007-03-17 01:16:23', 'updated' => date('Y-m-d H:i:s')
587587
));
588588
$this->assertEqual($user, $expected);
589-
$this->Controller->Session->del('Auth');
589+
$this->Controller->Session->delete('Auth');
590590

591591
$this->Controller->data['AuthUser']['username'] = 'blah';
592592
$this->Controller->data['AuthUser']['password'] = '';
@@ -595,7 +595,7 @@ function testLogin() {
595595

596596
$user = $this->Controller->Auth->user();
597597
$this->assertFalse($user);
598-
$this->Controller->Session->del('Auth');
598+
$this->Controller->Session->delete('Auth');
599599

600600
$this->Controller->data['AuthUser']['username'] = 'now() or 1=1 --';
601601
$this->Controller->data['AuthUser']['password'] = '';
@@ -604,7 +604,7 @@ function testLogin() {
604604

605605
$user = $this->Controller->Auth->user();
606606
$this->assertFalse($user);
607-
$this->Controller->Session->del('Auth');
607+
$this->Controller->Session->delete('Auth');
608608

609609
$this->Controller->data['AuthUser']['username'] = 'now() or 1=1 # something';
610610
$this->Controller->data['AuthUser']['password'] = '';
@@ -613,7 +613,7 @@ function testLogin() {
613613

614614
$user = $this->Controller->Auth->user();
615615
$this->assertFalse($user);
616-
$this->Controller->Session->del('Auth');
616+
$this->Controller->Session->delete('Auth');
617617

618618
$this->Controller->Auth->userModel = 'UuidUser';
619619
$this->Controller->Auth->login('47c36f9c-bc00-4d17-9626-4e183ca6822b');
@@ -623,7 +623,7 @@ function testLogin() {
623623
'id' => '47c36f9c-bc00-4d17-9626-4e183ca6822b', 'title' => 'Unique record 1', 'count' => 2, 'created' => '2008-03-13 01:16:23', 'updated' => '2008-03-13 01:18:31'
624624
));
625625
$this->assertEqual($user, $expected);
626-
$this->Controller->Session->del('Auth');
626+
$this->Controller->Session->delete('Auth');
627627
}
628628

629629
/**
@@ -642,7 +642,7 @@ function testAuthorizeFalse() {
642642
$result = $this->Controller->Auth->startup($this->Controller);
643643
$this->assertTrue($result);
644644

645-
$this->Controller->Session->del('Auth');
645+
$this->Controller->Session->delete('Auth');
646646
$result = $this->Controller->Auth->startup($this->Controller);
647647
$this->assertFalse($result);
648648
$this->assertTrue($this->Controller->Session->check('Message.auth'));
@@ -673,7 +673,7 @@ function testAuthorizeController() {
673673
$this->assertTrue($this->Controller->Session->check('Message.auth'));
674674
$this->assertFalse($result);
675675

676-
$this->Controller->Session->del('Auth');
676+
$this->Controller->Session->delete('Auth');
677677
}
678678

679679
/**
@@ -695,7 +695,7 @@ function testAuthorizeModel() {
695695
$result = $this->Controller->Auth->startup($this->Controller);
696696
$this->assertTrue($result);
697697

698-
$this->Controller->Session->del('Auth');
698+
$this->Controller->Session->delete('Auth');
699699
$this->Controller->Auth->startup($this->Controller);
700700
$this->assertTrue($this->Controller->Session->check('Message.auth'));
701701
$result = $this->Controller->Auth->isAuthorized();
@@ -759,7 +759,7 @@ function testAuthorizeCrud() {
759759
$this->Controller->Auth->startup($this->Controller);
760760
$this->assertTrue($this->Controller->Auth->isAuthorized());
761761

762-
$this->Controller->Session->del('Auth');
762+
$this->Controller->Session->delete('Auth');
763763
$this->Controller->Auth->startup($this->Controller);
764764
$this->assertTrue($this->Controller->Session->check('Message.auth'));
765765
}
@@ -932,7 +932,7 @@ function testLoginRedirect() {
932932
$expected = Router::normalize($this->Controller->Auth->loginRedirect);
933933
$this->assertEqual($expected, $this->Controller->Auth->redirect());
934934

935-
$this->Controller->Session->del('Auth');
935+
$this->Controller->Session->delete('Auth');
936936

937937
$this->Controller->params['url']['url'] = 'admin/';
938938
$this->Controller->Auth->initialize($this->Controller);
@@ -943,7 +943,7 @@ function testLoginRedirect() {
943943
$this->assertTrue($this->Controller->Session->check('Message.auth'));
944944
$this->assertEqual($expected, $this->Controller->Auth->redirect());
945945

946-
$this->Controller->Session->del('Auth');
946+
$this->Controller->Session->delete('Auth');
947947

948948
//empty referer no session
949949
$_SERVER['HTTP_REFERER'] = false;
@@ -971,7 +971,7 @@ function testLoginRedirect() {
971971
$this->assertEqual($expected, $this->Controller->testUrl);
972972

973973

974-
$this->Controller->Session->del('Auth');
974+
$this->Controller->Session->delete('Auth');
975975
$_SERVER['HTTP_REFERER'] = Router::url('/admin/', true);
976976

977977
$this->Controller->Session->write('Auth', array(
@@ -988,7 +988,7 @@ function testLoginRedirect() {
988988

989989
//Ticket #4750
990990
//named params
991-
$this->Controller->Session->del('Auth');
991+
$this->Controller->Session->delete('Auth');
992992
$url = '/posts/index/year:2008/month:feb';
993993
$this->Controller->params = Router::parse($url);
994994
$this->Controller->params['url']['url'] = Router::normalize($url);
@@ -1000,7 +1000,7 @@ function testLoginRedirect() {
10001000
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
10011001

10021002
//passed args
1003-
$this->Controller->Session->del('Auth');
1003+
$this->Controller->Session->delete('Auth');
10041004
$url = '/posts/view/1';
10051005
$this->Controller->params = Router::parse($url);
10061006
$this->Controller->params['url']['url'] = Router::normalize($url);
@@ -1018,7 +1018,7 @@ function testLoginRedirect() {
10181018
'print' => 'true',
10191019
'refer' => 'menu'
10201020
);
1021-
$this->Controller->Session->del('Auth');
1021+
$this->Controller->Session->delete('Auth');
10221022
$url = '/posts/index/29?print=true&refer=menu';
10231023
$this->Controller->params = Dispatcher::parseParams($url);
10241024
$this->Controller->Auth->initialize($this->Controller);
@@ -1034,7 +1034,7 @@ function testLoginRedirect() {
10341034
'refer' => 'menu',
10351035
'ext' => 'html'
10361036
);
1037-
$this->Controller->Session->del('Auth');
1037+
$this->Controller->Session->delete('Auth');
10381038
$url = '/posts/index/29?print=true&refer=menu';
10391039
$this->Controller->params = Dispatcher::parseParams($url);
10401040
$this->Controller->Auth->initialize($this->Controller);
@@ -1047,7 +1047,7 @@ function testLoginRedirect() {
10471047

10481048
//external authed action
10491049
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
1050-
$this->Controller->Session->del('Auth');
1050+
$this->Controller->Session->delete('Auth');
10511051
$url = '/posts/edit/1';
10521052
$this->Controller->params = Router::parse($url);
10531053
$this->Controller->params['url']['url'] = Router::normalize($url);
@@ -1060,7 +1060,7 @@ function testLoginRedirect() {
10601060

10611061
//external direct login link
10621062
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
1063-
$this->Controller->Session->del('Auth');
1063+
$this->Controller->Session->delete('Auth');
10641064
$url = '/AuthTest/login';
10651065
$this->Controller->params = Router::parse($url);
10661066
$this->Controller->params['url']['url'] = Router::normalize($url);
@@ -1072,7 +1072,7 @@ function testLoginRedirect() {
10721072
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
10731073

10741074
$_SERVER['HTTP_REFERER'] = $backup;
1075-
$this->Controller->Session->del('Auth');
1075+
$this->Controller->Session->delete('Auth');
10761076
}
10771077

10781078
/**
@@ -1082,7 +1082,7 @@ function testLoginRedirect() {
10821082
* @return void
10831083
**/
10841084
function testNoRedirectOn404() {
1085-
$this->Controller->Session->del('Auth');
1085+
$this->Controller->Session->delete('Auth');
10861086
$this->Controller->Auth->initialize($this->Controller);
10871087
$this->Controller->params = Router::parse('auth_test/something_totally_wrong');
10881088
$result = $this->Controller->Auth->startup($this->Controller);
@@ -1117,7 +1117,7 @@ function testEmptyUsernameOrPassword() {
11171117
$user = $this->Controller->Auth->user();
11181118
$this->assertTrue($this->Controller->Session->check('Message.auth'));
11191119
$this->assertEqual($user, false);
1120-
$this->Controller->Session->del('Auth');
1120+
$this->Controller->Session->delete('Auth');
11211121
}
11221122

11231123
/**
@@ -1142,7 +1142,7 @@ function testInjection() {
11421142
$this->Controller->Auth->startup($this->Controller);
11431143
$this->assertTrue(is_array($this->Controller->Auth->user()));
11441144

1145-
$this->Controller->Session->del($this->Controller->Auth->sessionKey);
1145+
$this->Controller->Session->delete($this->Controller->Auth->sessionKey);
11461146

11471147
$this->Controller->data['AuthUser']['username'] = 'nate';
11481148
$this->Controller->data['AuthUser']['password'] = 'cake1';
@@ -1154,7 +1154,7 @@ function testInjection() {
11541154
$this->Controller->Auth->startup($this->Controller);
11551155
$this->assertTrue(is_null($this->Controller->Auth->user()));
11561156

1157-
$this->Controller->Session->del($this->Controller->Auth->sessionKey);
1157+
$this->Controller->Session->delete($this->Controller->Auth->sessionKey);
11581158

11591159
$this->Controller->data['AuthUser']['username'] = '> n';
11601160
$this->Controller->data['AuthUser']['password'] = 'cake';
@@ -1251,7 +1251,7 @@ function testCustomRoute() {
12511251
$user = $this->Controller->Auth->user();
12521252
$this->assertTrue(!!$user);
12531253

1254-
$this->Controller->Session->del('Auth');
1254+
$this->Controller->Session->delete('Auth');
12551255
Router::reload();
12561256
Router::connect('/', array('controller' => 'people', 'action' => 'login'));
12571257
$url = '/';

0 commit comments

Comments
 (0)