Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PasswordConfirmationTest.php 789B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. use App\Models\User;
  3. test('confirm password screen can be rendered', function () {
  4. $user = User::factory()->create();
  5. $response = $this->actingAs($user)->get('/confirm-password');
  6. $response->assertStatus(200);
  7. });
  8. test('password can be confirmed', function () {
  9. $user = User::factory()->create();
  10. $response = $this->actingAs($user)->post('/confirm-password', [
  11. 'password' => 'password',
  12. ]);
  13. $response->assertRedirect();
  14. $response->assertSessionHasNoErrors();
  15. });
  16. test('password is not confirmed with invalid password', function () {
  17. $user = User::factory()->create();
  18. $response = $this->actingAs($user)->post('/confirm-password', [
  19. 'password' => 'wrong-password',
  20. ]);
  21. $response->assertSessionHasErrors();
  22. });