delete test

This commit is contained in:
2024-03-10 16:31:24 +03:30
parent d3b4f181d8
commit e636fdd240
3 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature\V2\Dashboard\RoadPatrolProject;
use App\Models\City;
use App\Models\EdarateOstani;
use App\Models\EdarateShahri;
use App\Models\InfoItem;
use App\Models\Permission;
use App\Models\RoadPatrol;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class DeleteTest extends TestCase
{
use RefreshDatabase, WithFaker;
/**
* A basic feature test example.
*/
public function test_type_is_required(): void
{
$user = User::factory()->create();
$roadPatrol = RoadPatrol::factory()->create();
$response = $this->actingAs($user)->postJson("v2/road_patrols/supervisor/cartable/delete/{$roadPatrol->id}");
$response->assertUnprocessable()
->assertInvalid([
'type' => __('validation.required', ['attribute' => 'type'])
]);
}
}