write tests for azmayesh resources
This commit is contained in:
32
tests/Feature/V3/AzmayeshSample/DeleteTest.php
Normal file
32
tests/Feature/V3/AzmayeshSample/DeleteTest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user