33 lines
867 B
PHP
33 lines
867 B
PHP
<?php
|
|
|
|
namespace Tests\Feature\V3\AzmayeshSample;
|
|
|
|
use App\Models\Azmayesh;
|
|
use App\Models\AzmayeshSample;
|
|
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_sample(): void
|
|
{
|
|
$user = User::factory()->create();
|
|
$azmayeshSample = AzmayeshSample::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->postJson(route('v3.azmayesh_samples.delete', [$azmayeshSample->id]));
|
|
|
|
$response->assertOk();
|
|
|
|
$this->assertDatabaseMissing('azmayesh_samples', [
|
|
'azmayesh_id' => $azmayeshSample->azmayesh_id,
|
|
'data' => $azmayeshSample->data,
|
|
]);
|
|
}
|
|
}
|