diff --git a/phpunit.xml b/phpunit.xml index a894410..1160168 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,24 +1,16 @@ - - - - ./tests/Unit - - - - - src - - - - - + + + + src + + + + + ./tests/Unit + + + + + diff --git a/phpunit.xml.bak b/phpunit.xml.bak new file mode 100644 index 0000000..a894410 --- /dev/null +++ b/phpunit.xml.bak @@ -0,0 +1,24 @@ + + + + + ./tests/Unit + + + + + src + + + + + + diff --git a/tests/Unit/GeocodingServiceTest.php b/tests/Unit/GeocodingServiceTest.php deleted file mode 100644 index 6289184..0000000 --- a/tests/Unit/GeocodingServiceTest.php +++ /dev/null @@ -1,67 +0,0 @@ -mockedGeocoder = Mockery::mock('overload:Spatie\Geocoder\Geocoder'); - - // Configurando o mock para esperar a chamada de setApiKey - $this->mockedGeocoder->shouldReceive('setApiKey')->once()->withAnyArgs(); - $this->mockedGeocoder->shouldReceive('setRegion')->once()->withAnyArgs(); - $this->mockedGeocoder->shouldReceive('setCountry')->once()->withAnyArgs(); - $this->mockedGeocoder->shouldReceive('setBounds')->once()->withAnyArgs(); - - // Configurando o mock para esperar a chamada de getCoordinatesForAddress - $this->mockedGeocoder->shouldReceive('getCoordinatesForAddress') - ->once() - ->with('Brussels, Belgium') - ->andReturn(['lat' => '50.85045', 'lng' => '4.34878']); - - $this->geocodingService = new GeocodingService(); - } - - - - /** - * Test getCoordinatesForAddress function - */ - public function testGetCoordinatesForAddress(): void - { - // Mocking Geocoder response - $this->mockedGeocoder->shouldReceive('getCoordinatesForAddress') - ->once() - ->with('Brussels, Belgium') - ->andReturn(['lat' => '50.85045', 'lng' => '4.34878']); - - // Testing the function - $result = $this->geocodingService->getCoordinatesForAddress('Brussels, Belgium'); - $this->assertEquals(['lat' => '50.85045', 'lng' => '4.34878'], $result); - } - - /** - * Tear down the test - */ - public function tearDown(): void - { - Mockery::close(); - parent::tearDown(); - } -} \ No newline at end of file