use DataBaseTruncation instead of RefreshDataBase
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user