mock nominatim service
This commit is contained in:
@@ -10,9 +10,11 @@ use App\Models\LogList;
|
|||||||
use App\Models\Permission;
|
use App\Models\Permission;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\UserActivityLog;
|
use App\Models\UserActivityLog;
|
||||||
|
use App\Services\NominatimService;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Illuminate\Foundation\Testing\WithFaker;
|
use Illuminate\Foundation\Testing\WithFaker;
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
|
use Mockery\MockInterface;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class operatorFirstStepStoreTest extends TestCase
|
class operatorFirstStepStoreTest extends TestCase
|
||||||
@@ -282,6 +284,12 @@ class operatorFirstStepStoreTest extends TestCase
|
|||||||
'recognize_picture' => $image
|
'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 = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step', $data);
|
||||||
|
|
||||||
$response->assertOk();
|
$response->assertOk();
|
||||||
@@ -299,6 +307,7 @@ class operatorFirstStepStoreTest extends TestCase
|
|||||||
'activity_date_time' => $data['activity_date']." ".$data['activity_time'],
|
'activity_date_time' => $data['activity_date']." ".$data['activity_time'],
|
||||||
'edare_shahri_id' => $edarateShari->id,
|
'edare_shahri_id' => $edarateShari->id,
|
||||||
'edare_shahri_name' => $edarateShari->name,
|
'edare_shahri_name' => $edarateShari->name,
|
||||||
|
'way_id' => 0
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user