PHP Classes

File: tests/Feature/Auth/PasswordConfirmationTest.php

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   Laravel Stripe Checkout   tests/Feature/Auth/PasswordConfirmationTest.php   Download  
File: tests/Feature/Auth/PasswordConfirmationTest.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Laravel Stripe Checkout
E-commerce checkout that uses Stripe to pay orders
Author: By
Last change:
Date: 1 year ago
Size: 789 bytes
 

Contents

Class file image Download
<?php

use App\Models\User;

test('confirm password screen can be rendered', function () {
   
$user = User::factory()->create();

   
$response = $this->actingAs($user)->get('/confirm-password');

   
$response->assertStatus(200);
});

test('password can be confirmed', function () {
   
$user = User::factory()->create();

   
$response = $this->actingAs($user)->post('/confirm-password', [
       
'password' => 'password',
    ]);

   
$response->assertRedirect();
   
$response->assertSessionHasNoErrors();
});

test('password is not confirmed with invalid password', function () {
   
$user = User::factory()->create();

   
$response = $this->actingAs($user)->post('/confirm-password', [
       
'password' => 'wrong-password',
    ]);

   
$response->assertSessionHasErrors();
});