mirror of https://github.com/4xmen/xshop.git
added siemap and customer test
parent
b7665af600
commit
2ea6356c53
@ -0,0 +1,29 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SiteMapTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
public function test_sitemap(): void
|
||||
{
|
||||
$response = $this->get(route('sitemap'));
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue