mock nominatim service

This commit is contained in:
2024-03-09 14:04:03 +03:30
parent c0d991cdc0
commit 6d6f5996b9

View File

@@ -10,9 +10,11 @@ use App\Models\LogList;
use App\Models\Permission;
use App\Models\User;
use App\Models\UserActivityLog;
use App\Services\NominatimService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\UploadedFile;
use Mockery\MockInterface;
use Tests\TestCase;
class operatorFirstStepStoreTest extends TestCase
@@ -282,6 +284,12 @@ class operatorFirstStepStoreTest extends TestCase
'recognize_picture' => $image
];
$mock = $this->mock(NominatimService::class, function (MockInterface $mock) {
$mock->shouldReceive('get_way_id_from_nominatim')
->once()
->andReturn(0);
});
$response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step', $data);
$response->assertOk();
@@ -299,6 +307,7 @@ class operatorFirstStepStoreTest extends TestCase
'activity_date_time' => $data['activity_date']." ".$data['activity_time'],
'edare_shahri_id' => $edarateShari->id,
'edare_shahri_name' => $edarateShari->name,
'way_id' => 0
]);
}
}