You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xshop/tests/Feature/CustomerTest.php

30 lines
635 B
PHTML

<?php
namespace Tests\Feature;
use App\Models\Customer;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class CustomerTest extends TestCase
{
public function check(){
if (Customer::count() == 0){
Customer::factory(1)->create();
}
}
/**
* A basic feature test example.
*/
public function test_customer_profile(): void
{
$this->check();
$response = $this->actingAs(Customer::inRandomOrder()->first(),'customer')->get(route('client.profile'));
$response->assertStatus(200);
}
}