45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\V3\Azmayesh;
|
|
|
|
use App\Models\Azmayesh;
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Foundation\Testing\WithFaker;
|
|
use Tests\TestCase;
|
|
|
|
class DeleteTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
/**
|
|
* A basic feature test example.
|
|
*/
|
|
public function test_user_can_delete_azmayesh(): void
|
|
{
|
|
$user = User::factory()->create();
|
|
$azmayesh = Azmayesh::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->postJson(route('v3.azmayeshes.delete', [$azmayesh->id]));
|
|
|
|
$response->assertOk();
|
|
|
|
$this->assertDatabaseMissing('azmayeshes', [
|
|
'lat' => $azmayesh->lat,
|
|
'lng' => $azmayesh->lng,
|
|
'azmayesh_type_id' => $azmayesh->azmayesh_type_id,
|
|
'azmayesh_type_name' => $azmayesh->azmayesh_type_name,
|
|
'request_date' => $azmayesh->request_date,
|
|
'report_date' => $azmayesh->report_date,
|
|
'request_number' => $azmayesh->request_number,
|
|
'employer' => $azmayesh->employer,
|
|
'contractor' => $azmayesh->contractor,
|
|
'work_number' => $azmayesh->work_number,
|
|
'project_name' => $azmayesh->project_name,
|
|
'consultant' => $azmayesh->consultant,
|
|
'applicant' => $azmayesh->applicant,
|
|
'province_id' => $azmayesh->province_id,
|
|
'province_name' => $azmayesh->province_name,
|
|
]);
|
|
}
|
|
}
|