11
11
12
12
class AuthenticationTest extends KernelTestCase
13
13
{
14
- use HasBrowser, Factories, ResetDatabase;
14
+ use Factories;
15
+ use HasBrowser;
16
+ use ResetDatabase;
15
17
16
- /**
17
- * @test
18
- */
19
- public function can_login_and_logout (): void
18
+ public function testCanLoginAndLogout (): void
20
19
{
21
20
UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
22
21
@@ -35,10 +34,7 @@ public function can_login_and_logout(): void
35
34
;
36
35
}
37
36
38
- /**
39
- * @test
40
- */
41
- public function login_with_target (): void
37
+ public function testLoginWithTarget (): void
42
38
{
43
39
UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
44
40
@@ -53,10 +49,7 @@ public function login_with_target(): void
53
49
;
54
50
}
55
51
56
- /**
57
- * @test
58
- */
59
- public function login_with_invalid_password (): void
52
+ public function testLoginWithInvalidPassword (): void
60
53
{
61
54
UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
62
55
@@ -73,10 +66,7 @@ public function login_with_invalid_password(): void
73
66
;
74
67
}
75
68
76
- /**
77
- * @test
78
- */
79
- public function login_with_invalid_email (): void
69
+ public function testLoginWithInvalidEmail (): void
80
70
{
81
71
$ this ->browser ()
82
72
->visit ('/login ' )
@@ -91,10 +81,7 @@ public function login_with_invalid_email(): void
91
81
;
92
82
}
93
83
94
- /**
95
- * @test
96
- */
97
- public function login_with_invalid_csrf (): void
84
+ public function testLoginWithInvalidCsrf (): void
98
85
{
99
86
UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
100
87
@@ -108,10 +95,7 @@ public function login_with_invalid_csrf(): void
108
95
;
109
96
}
110
97
111
- /**
112
- * @test
113
- */
114
- public function remember_me_enabled_by_default (): void
98
+ public function testRememberMeEnabledByDefault (): void
115
99
{
116
100
UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
117
101
@@ -128,10 +112,7 @@ public function remember_me_enabled_by_default(): void
128
112
;
129
113
}
130
114
131
- /**
132
- * @test
133
- */
134
- public function can_disable_remember_me (): void
115
+ public function testCanDisableRememberMe (): void
135
116
{
136
117
UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
137
118
@@ -149,10 +130,7 @@ public function can_disable_remember_me(): void
149
130
;
150
131
}
151
132
152
- /**
153
- * @test
154
- */
155
- public function fully_authenticated_login_redirect (): void
133
+ public function testFullyAuthenticatedLoginRedirect (): void
156
134
{
157
135
UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
158
136
@@ -169,10 +147,7 @@ public function fully_authenticated_login_redirect(): void
169
147
;
170
148
}
171
149
172
- /**
173
- * @test
174
- */
175
- public function fully_authenticated_login_target (): void
150
+ public function testFullyAuthenticatedLoginTarget (): void
176
151
{
177
152
UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
178
153
@@ -189,10 +164,7 @@ public function fully_authenticated_login_target(): void
189
164
;
190
165
}
191
166
192
- /**
193
- * @test
194
- */
195
- public function can_fully_authenticate_if_only_remembered (): void
167
+ public function testCanFullyAuthenticateIfOnlyRemembered (): void
196
168
{
197
169
UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
198
170
@@ -213,18 +185,15 @@ public function can_fully_authenticate_if_only_remembered(): void
213
185
;
214
186
}
215
187
216
- /**
217
- * @test
218
- */
219
- public function legacy_password_hash_is_automatically_migrated_on_login (): void
188
+ public function testLegacyPasswordHashIsAutomaticallyMigratedOnLogin (): void
220
189
{
221
190
$ user = UserFactory::
createOne ([
'email ' =>
'[email protected] ' ,
'password ' =>
'1234 ' ]);
222
191
223
192
// set the password to a legacy hash (argon2id, 1234)
224
193
$ user ->setPassword ('$argon2id$v=19$m=10,t=3,p=1$K9AFR15goJiUD6AdpK0a6Q$RsP6y+FRnYUBovBmhVZO7wN6Caj2eI8dMTnm3+5aTxk ' );
225
194
$ user ->save ();
226
195
227
- $ this ->assertSame (\PASSWORD_ARGON2ID , \ password_get_info ($ user ->getPassword ())['algo ' ]);
196
+ $ this ->assertSame (\PASSWORD_ARGON2ID , password_get_info ($ user ->getPassword ())['algo ' ]);
228
197
229
198
$ this ->browser ()
230
199
->use (Authentication::assertNotAuthenticated ())
@@ -237,22 +206,16 @@ public function legacy_password_hash_is_automatically_migrated_on_login(): void
237
206
->
use (Authentication::
assertAuthenticatedAs (
'[email protected] ' ))
238
207
;
239
208
240
- $ this ->assertSame (\PASSWORD_DEFAULT , \ password_get_info ($ user ->getPassword ())['algo ' ]);
209
+ $ this ->assertSame (\PASSWORD_DEFAULT , password_get_info ($ user ->getPassword ())['algo ' ]);
241
210
}
242
211
243
- /**
244
- * @test
245
- */
246
- public function auto_redirected_to_authenticated_resource_after_login (): void
212
+ public function testAutoRedirectedToAuthenticatedResourceAfterLogin (): void
247
213
{
248
214
// complete this test when you have a page that requires authentication
249
215
$ this ->markTestIncomplete ();
250
216
}
251
217
252
- /**
253
- * @test
254
- */
255
- public function auto_redirected_to_fully_authenticated_resource_after_fully_authenticated (): void
218
+ public function testAutoRedirectedToFullyAuthenticatedResourceAfterFullyAuthenticated (): void
256
219
{
257
220
// complete this test when/if you have a page that requires the user be "fully authenticated"
258
221
$ this ->markTestIncomplete ();
0 commit comments