use DataBaseTruncation instead of RefreshDataBase

This commit is contained in:
2024-04-14 14:13:16 +03:30
parent 8a87c201f6
commit 7e63c3eda0
35 changed files with 1927 additions and 194 deletions

View File

@@ -8,8 +8,7 @@ use App\Models\Permission;
use App\Models\RoadObserved;
use App\Models\User;
use App\Services\NikarayanService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\DatabaseTruncation;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Mockery\MockInterface;
@@ -17,7 +16,7 @@ use Tests\TestCase;
class HandleTest extends TestCase
{
use RefreshDatabase, WithFaker;
use DatabaseTruncation;
/**
* A basic feature test example.
*/
@@ -27,6 +26,10 @@ class HandleTest extends TestCase
$roadObserved = RoadObserved::factory()->create();
$this->mock(NikarayanService::class, function (MockInterface $mock) {
$mock->shouldReceive('updateRoadObservedInfoByNikarayan')->andReturn(0);
});
$response = $this->actingAs($user)->postJson("/v2/road_observations/handle/{$roadObserved->id}");
$response->assertForbidden();