@@ -38,7 +38,7 @@ class FormAuthenticateTest extends TestCase {
38
38
*
39
39
* @var array
40
40
*/
41
- public $ fixtures = array ( 'core.user ' , 'core.auth_user ' ) ;
41
+ public $ fixtures = [ 'core.user ' , 'core.auth_user ' ] ;
42
42
43
43
/**
44
44
* setup
@@ -48,9 +48,9 @@ class FormAuthenticateTest extends TestCase {
48
48
public function setUp () {
49
49
parent ::setUp ();
50
50
$ this ->Collection = $ this ->getMock ('Cake\Controller\ComponentRegistry ' );
51
- $ this ->auth = new FormAuthenticate ($ this ->Collection , array (
51
+ $ this ->auth = new FormAuthenticate ($ this ->Collection , [
52
52
'userModel ' => 'Users '
53
- ) );
53
+ ] );
54
54
$ password = Security::hash ('password ' , 'blowfish ' , false );
55
55
$ Users = TableRegistry::get ('Users ' );
56
56
$ Users ->updateAll (['password ' => $ password ], []);
@@ -63,12 +63,12 @@ public function setUp() {
63
63
* @return void
64
64
*/
65
65
public function testConstructor () {
66
- $ object = new FormAuthenticate ($ this ->Collection , array (
66
+ $ object = new FormAuthenticate ($ this ->Collection , [
67
67
'userModel ' => 'AuthUsers ' ,
68
- 'fields ' => array ( 'username ' => 'user ' , 'password ' => 'password ' )
69
- ) );
68
+ 'fields ' => [ 'username ' => 'user ' , 'password ' => 'password ' ]
69
+ ] );
70
70
$ this ->assertEquals ('AuthUsers ' , $ object ->config ('userModel ' ));
71
- $ this ->assertEquals (array ( 'username ' => 'user ' , 'password ' => 'password ' ) , $ object ->config ('fields ' ));
71
+ $ this ->assertEquals ([ 'username ' => 'user ' , 'password ' => 'password ' ] , $ object ->config ('fields ' ));
72
72
}
73
73
74
74
/**
@@ -133,13 +133,13 @@ public function testAuthenticatePasswordIsEmptyString() {
133
133
134
134
$ this ->auth = $ this ->getMock (
135
135
'Cake\Controller\Component\Auth\FormAuthenticate ' ,
136
- array ( '_checkFields ' ) ,
137
- array (
136
+ [ '_checkFields ' ] ,
137
+ [
138
138
$ this ->Collection ,
139
- array (
139
+ [
140
140
'userModel ' => 'Users '
141
- )
142
- )
141
+ ]
142
+ ]
143
143
);
144
144
145
145
// Simulate that check for ensuring password is not empty is missing.
@@ -196,12 +196,12 @@ public function testAuthenticateSuccess() {
196
196
'password ' => 'password '
197
197
];
198
198
$ result = $ this ->auth ->authenticate ($ request , $ this ->response );
199
- $ expected = array (
199
+ $ expected = [
200
200
'id ' => 1 ,
201
201
'username ' => 'mariano ' ,
202
202
'created ' => new \DateTime ('2007-03-17 01:16:23 ' ),
203
203
'updated ' => new \DateTime ('2007-03-17 01:18:31 ' )
204
- ) ;
204
+ ] ;
205
205
$ this ->assertEquals ($ expected , $ result );
206
206
}
207
207
@@ -245,12 +245,12 @@ public function testPluginModel() {
245
245
];
246
246
247
247
$ result = $ this ->auth ->authenticate ($ request , $ this ->response );
248
- $ expected = array (
248
+ $ expected = [
249
249
'id ' => 1 ,
250
250
'username ' => 'gwoo ' ,
251
251
'created ' => new \DateTime ('2007-03-17 01:16:23 ' ),
252
252
'updated ' => new \DateTime ('2007-03-17 01:18:31 ' )
253
- ) ;
253
+ ] ;
254
254
$ this ->assertEquals ($ expected , $ result );
255
255
Plugin::unload ();
256
256
}
@@ -273,8 +273,8 @@ public function testPasswordHasherSettings() {
273
273
$ hash = Security::hash ('mypass ' , 'md5 ' , true );
274
274
$ User = TableRegistry::get ('Users ' );
275
275
$ User ->updateAll (
276
- array ( 'password ' => $ hash) ,
277
- array ( 'username ' => 'mariano ' )
276
+ [ 'password ' => $ hash] ,
277
+ [ 'username ' => 'mariano ' ]
278
278
);
279
279
280
280
$ request = new Request ('posts/index ' );
@@ -284,18 +284,18 @@ public function testPasswordHasherSettings() {
284
284
];
285
285
286
286
$ result = $ this ->auth ->authenticate ($ request , $ this ->response );
287
- $ expected = array (
287
+ $ expected = [
288
288
'id ' => 1 ,
289
289
'username ' => 'mariano ' ,
290
290
'created ' => new \DateTime ('2007-03-17 01:16:23 ' ),
291
291
'updated ' => new \DateTime ('2007-03-17 01:18:31 ' )
292
- ) ;
292
+ ] ;
293
293
$ this ->assertEquals ($ expected , $ result );
294
294
295
- $ this ->auth = new FormAuthenticate ($ this ->Collection , array (
296
- 'fields ' => array ( 'username ' => 'username ' , 'password ' => 'password ' ) ,
295
+ $ this ->auth = new FormAuthenticate ($ this ->Collection , [
296
+ 'fields ' => [ 'username ' => 'username ' , 'password ' => 'password ' ] ,
297
297
'userModel ' => 'Users '
298
- ) );
298
+ ] );
299
299
$ this ->auth ->config ('passwordHasher ' , [
300
300
'className ' => 'Simple ' ,
301
301
'hashType ' => 'sha1 '
0 commit comments