diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a6d58a2..fdbe76a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,38 +12,25 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.4, 8.3, 8.2, 8.1, 8.0] - laravel: ['9.*', '10.*', '11.*', '12.*'] + php: [8.4, 8.3] + laravel: ['11.*', '12.*', '13.*'] dependency-version: [prefer-stable] include: - - laravel: 10.* - testbench: 8.* - - laravel: 9.* - testbench: 7.* - laravel: 11.* testbench: 9.* - laravel: 12.* testbench: 10.* - exclude: - - laravel: 10.* - php: 8.0 - - laravel: 11.* - php: 8.1 - - laravel: 11.* - php: 8.0 - - laravel: 12.* - php: 8.1 - - laravel: 12.* - php: 8.0 + - laravel: 13.* + testbench: 11.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} diff --git a/composer.json b/composer.json index 40b004a..47b8f61 100644 --- a/composer.json +++ b/composer.json @@ -17,13 +17,13 @@ } ], "require": { - "php": "^7.2|^8.0", - "illuminate/support": "^6.0|^7.0|^8.67|^9.0|^10.0|^11.0|^12.0", + "php": "^8.3", + "illuminate/support": "^11.0|^12.0|^13.0", "guzzlehttp/guzzle": "^6.5|^7.0" }, "require-dev": { - "phpunit/phpunit": "^8.5.21|^9.0|^9.4.4|^10.5|^11.5.3", - "orchestra/testbench": "^4.0|^5.0|^6.0|^8.0|^9.0|^10.0" + "phpunit/phpunit": "^11.5.3|^12.5.12", + "orchestra/testbench": "^9.0|^10.0|^11.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 92ed9fe..68bf1ba 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,10 +1,10 @@ - - + + src/ - + tests diff --git a/tests/GeocoderTest.php b/tests/GeocoderTest.php index 60bf08d..5c8babb 100644 --- a/tests/GeocoderTest.php +++ b/tests/GeocoderTest.php @@ -29,7 +29,7 @@ public function setUp(): void } /** @test */ - public function it_can_geocode_a_city() + public function test_it_can_geocode_a_city() { $result = $this->geocoder->getCoordinatesForAddress('Antwerp'); @@ -41,7 +41,7 @@ public function it_can_geocode_a_city() } /** @test */ - public function it_can_geocode_a_city_with_multiple_responses() + public function test_it_can_geocode_a_city_with_multiple_responses() { $results = $this->geocoder->getAllCoordinatesForAddress('Washingtons'); @@ -58,23 +58,23 @@ public function it_can_geocode_a_city_with_multiple_responses() } /** @test */ - public function it_should_return_an_empty_response_when_called_with_empty_query() + public function test_it_should_return_an_empty_response_when_called_with_empty_query() { $this->assertEquals($this->emptyResponse(), $this->geocoder->getCoordinatesForAddress('')); } /** @test */ - public function it_should_return_an_empty_response_when_using_a_non_existing_city() + public function test_it_should_return_an_empty_response_when_using_a_non_existing_city() { $this->assertEquals($this->emptyResponse(), $this->geocoder->getCoordinatesForAddress('Spatieville')); } /** @test */ - public function it_can_translate_the_data() + public function test_it_can_translate_the_data() { $result = $this->geocoder->getCoordinatesForAddress('Roma, Italy'); - $this->assertEquals('Rome, Metropolitan City of Rome, Italy', $result['formatted_address']); + $this->assertEquals('Rome, Metropolitan City of Rome Capital, Italy', $result['formatted_address']); $result = $this->geocoder ->setLanguage('it') @@ -84,21 +84,21 @@ public function it_can_translate_the_data() } /** @test */ - public function it_can_translate_coordinates_to_an_address() + public function test_it_can_translate_coordinates_to_an_address() { $result = $this->geocoder->getAddressForCoordinates(40.714224, -73.961452); - $this->assertEquals('277 Bedford Ave, Brooklyn, NY 11211, USA', $result['formatted_address']); + $this->assertEquals('279 Bedford Ave, Brooklyn, NY 11211, USA', $result['formatted_address']); $result = $this->geocoder ->setLanguage('nl') ->getAddressForCoordinates(40.714224, -73.961452); - $this->assertEquals('277 Bedford Ave, Brooklyn, NY 11211, Verenigde Staten', $result['formatted_address']); + $this->assertEquals('279 Bedford Ave, Brooklyn, NY 11211, Verenigde Staten', $result['formatted_address']); } /** @test */ - public function it_can_translate_coordinates_to_multiple_addresses() + public function test_it_can_translate_coordinates_to_multiple_addresses() { $results = $this->geocoder->getAllAddressesForCoordinates(40.714224, -73.961452); @@ -107,17 +107,17 @@ public function it_can_translate_coordinates_to_multiple_addresses() $result = $results[0]; - $this->assertEquals('277 Bedford Ave, Brooklyn, NY 11211, USA', $result['formatted_address']); + $this->assertEquals('279 Bedford Ave, Brooklyn, NY 11211, USA', $result['formatted_address']); $result = $this->geocoder ->setLanguage('nl') ->getAddressForCoordinates(40.714224, -73.961452); - $this->assertEquals('277 Bedford Ave, Brooklyn, NY 11211, Verenigde Staten', $result['formatted_address']); + $this->assertEquals('279 Bedford Ave, Brooklyn, NY 11211, Verenigde Staten', $result['formatted_address']); } /** @test */ - public function it_can_include_the_address_components_in_a_response() + public function test_it_can_include_the_address_components_in_a_response() { $results = $this->geocoder->getCoordinatesForAddress('Infinite Loop 1, Cupertino'); @@ -125,7 +125,7 @@ public function it_can_include_the_address_components_in_a_response() } /** @test */ - public function it_includes_the_place_id_in_a_response() + public function test_it_includes_the_place_id_in_a_response() { $results = $this->geocoder->getCoordinatesForAddress('Infinite Loop 1, Cupertino'); @@ -133,17 +133,17 @@ public function it_includes_the_place_id_in_a_response() } /** @test */ - public function it_should_prefer_a_neighborhood_inside_of_payload_bounds() + public function test_it_should_prefer_a_neighborhood_inside_of_payload_bounds() { $results = $this->geocoder ->setBounds('34.172684,-118.604794|34.236144,-118.500938') ->getCoordinatesForAddress('Winnetka'); - $this->assertEquals('Winnetka, IL, USA', $results['formatted_address']); + $this->assertEquals('Winnetka, Los Angeles, CA, USA', $results['formatted_address']); } /** @test */ - public function it_can_be_used_with_a_laravel_facade() + public function test_it_can_be_used_with_a_laravel_facade() { config()->set('geocoder.key', $this->getApiKey()); @@ -153,7 +153,7 @@ public function it_can_be_used_with_a_laravel_facade() } /** @test */ - public function it_can_be_resolved_from_the_container_with_the_alias() + public function test_it_can_be_resolved_from_the_container_with_the_alias() { config()->set('geocoder.key', $this->getApiKey()); @@ -163,7 +163,7 @@ public function it_can_be_resolved_from_the_container_with_the_alias() } /** @test */ - public function it_can_be_resolved_from_the_container_with_the_full_class_name() + public function test_it_can_be_resolved_from_the_container_with_the_full_class_name() { config()->set('geocoder.key', $this->getApiKey());