resolve the dependency injection

This commit is contained in:
2024-04-08 14:44:00 +03:30
parent 92c50280fc
commit 8a87c201f6
2 changed files with 1 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ class NikarayanServiceProvider extends ServiceProvider
*/
public function boot(): void
{
$this->app->bind(NikarayanServiceProvider::class, function () {
$this->app->bind(NikarayanService::class, function () {
$url = "https://riws.rmto.ir/WebServices/NRPTrafficStatus.asmx?wsdl";
$soapClient = new SoapClient($url);
return new NikarayanService($soapClient);

View File

@@ -27,10 +27,6 @@ class HandleTest extends TestCase
$roadObserved = RoadObserved::factory()->create();
$mock = $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();