|
41 | 41 | ->assertInvalid([
|
42 | 42 | 'name' => 'The name field is required.',
|
43 | 43 | 'email' => 'The email field is required.',
|
44 |
| - 'username'=> 'The username field is required.', |
45 |
| - 'rules'=> 'The rules must be accepted.', |
| 44 | + 'username' => 'The username field is required.', |
| 45 | + 'rules' => 'The rules must be accepted.', |
46 | 46 | ]);
|
47 | 47 | });
|
48 | 48 |
|
|
56 | 56 | 'terms' => true,
|
57 | 57 | ])
|
58 | 58 | ->assertInvalid([
|
59 |
| - 'username' => 'The username must only contain letters, numbers, dashes and underscores.' |
| 59 | + 'username' => 'The username must only contain letters, numbers, dashes and underscores.', |
60 | 60 | ]);
|
61 | 61 | });
|
62 | 62 |
|
|
65 | 65 |
|
66 | 66 | $response = $this->withSession(['githubData' => ['id' => 123, 'username' => 'johndoe']])
|
67 | 67 | ->post('/register', [
|
68 |
| - 'name'=> 'John Doe', |
| 68 | + 'name' => 'John Doe', |
69 | 69 |
|
70 | 70 | 'username' => 'johndoe',
|
71 | 71 | 'rules' => true,
|
72 |
| - 'terms' => true |
| 72 | + 'terms' => true, |
73 | 73 | ]);
|
74 | 74 |
|
75 | 75 | $this->followRedirects($response)
|
76 | 76 | ->assertSee(new HtmlString(
|
77 | 77 | 'We already found a user with the given GitHub account (@johndoe). Would you like to <a href="http://localhost/login">login</a> instead?'
|
78 |
| - ) |
| 78 | + ) |
79 | 79 | );
|
80 | 80 | });
|
81 | 81 |
|
|
100 | 100 | $this->createUser();
|
101 | 101 |
|
102 | 102 | $this->post('login', [
|
103 |
| - 'username' => 'johndoe', |
104 |
| - 'password' => 'password' |
105 |
| - ]); |
| 103 | + 'username' => 'johndoe', |
| 104 | + 'password' => 'password', |
| 105 | + ]); |
106 | 106 |
|
107 | 107 | $this->assertAuthenticated();
|
108 | 108 | });
|
|
125 | 125 |
|
126 | 126 | $response->assertInvalid([
|
127 | 127 | 'username' => 'The username field is required.',
|
128 |
| - 'password' => 'The password field is required.' |
| 128 | + 'password' => 'The password field is required.', |
129 | 129 | ]);
|
130 | 130 | });
|
131 | 131 |
|
|
134 | 134 |
|
135 | 135 | $response = $this->post('login', [
|
136 | 136 | 'username' => 'johndoe',
|
137 |
| - 'password' => 'invalidpass' |
| 137 | + 'password' => 'invalidpass', |
138 | 138 | ]);
|
139 | 139 |
|
140 | 140 | $response->assertInvalid([
|
141 |
| - 'username' => 'These credentials do not match our records.' |
| 141 | + 'username' => 'These credentials do not match our records.', |
142 | 142 | ]);
|
143 | 143 | });
|
144 | 144 |
|
|
148 | 148 | $response = $this->actingAs($user)
|
149 | 149 | ->post('/login', [
|
150 | 150 | 'username' => 'johndoe',
|
151 |
| - 'password' => 'password' |
| 151 | + 'password' => 'password', |
152 | 152 | ])
|
153 | 153 | ->assertRedirect('/');
|
154 | 154 |
|
|
172 | 172 | $this->createUser();
|
173 | 173 |
|
174 | 174 | $this->post('password/email', [
|
175 |
| - |
| 175 | + |
176 | 176 | ])
|
177 |
| - ->assertSessionHas('status', 'We have emailed your password reset link!'); |
| 177 | + ->assertSessionHas('status', 'We have emailed your password reset link!'); |
178 | 178 | });
|
179 | 179 |
|
180 | 180 | test('users can reset their password', function () {
|
|
184 | 184 | $token = $this->app[PasswordBroker::class]->getRepository()->create($user);
|
185 | 185 |
|
186 | 186 | $this->post('/password/reset', [
|
187 |
| - 'token' => $token, |
188 |
| - |
189 |
| - 'password' => 'QFq^$cz#P@MZa5z7', |
190 |
| - 'password_confirmation' => 'QFq^$cz#P@MZa5z7' |
191 |
| - ]) |
| 187 | + 'token' => $token, |
| 188 | + |
| 189 | + 'password' => 'QFq^$cz#P@MZa5z7', |
| 190 | + 'password_confirmation' => 'QFq^$cz#P@MZa5z7', |
| 191 | + ]) |
192 | 192 | ->assertRedirect();
|
193 | 193 |
|
194 | 194 | $this->actingAs($user)
|
195 | 195 | ->post('logout');
|
196 |
| - |
| 196 | + |
197 | 197 | assertLoggedOut();
|
198 | 198 |
|
199 | 199 | $this->post('login', [
|
200 | 200 | 'username' => 'johndoe',
|
201 |
| - 'password' => 'QFq^$cz#P@MZa5z7' |
| 201 | + 'password' => 'QFq^$cz#P@MZa5z7', |
202 | 202 | ]);
|
203 | 203 |
|
204 | 204 | assertLoggedIn();
|
|
214 | 214 | 'token' => $token,
|
215 | 215 |
|
216 | 216 | 'password' => 'password',
|
217 |
| - 'password_confirmation' => 'password' |
| 217 | + 'password_confirmation' => 'password', |
218 | 218 | ]);
|
219 | 219 |
|
220 | 220 | $response->assertSessionHasErrors([
|
221 |
| - 'password' => 'The given password has appeared in a data leak. Please choose a different password.' |
| 221 | + 'password' => 'The given password has appeared in a data leak. Please choose a different password.', |
222 | 222 | ]);
|
223 | 223 | });
|
224 | 224 |
|
|
0 commit comments