From 820ec1fffd437eb057aba54ee6f34f58609d3445 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Fri, 20 Feb 2026 23:58:53 +0100 Subject: [PATCH 1/3] Add Laravel 13.x compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update illuminate/support constraint to include ^13.0 - Update phpunit and testbench dev dependencies - Add L13 matrix entries with PHP 8.3+ requirement - Update actions/cache v1 → v4 and actions/checkout v3 → v4 --- .github/workflows/run-tests.yml | 14 +++++++++++--- composer.json | 6 +++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a6d58a2..efd4bb2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ jobs: matrix: os: [ubuntu-latest] php: [8.4, 8.3, 8.2, 8.1, 8.0] - laravel: ['9.*', '10.*', '11.*', '12.*'] + laravel: ['9.*', '10.*', '11.*', '12.*', '13.*'] dependency-version: [prefer-stable] include: - laravel: 10.* @@ -24,6 +24,8 @@ jobs: testbench: 9.* - laravel: 12.* testbench: 10.* + - laravel: 13.* + testbench: 11.* exclude: - laravel: 10.* php: 8.0 @@ -35,15 +37,21 @@ jobs: php: 8.1 - laravel: 12.* php: 8.0 + - laravel: 13.* + php: 8.2 + - laravel: 13.* + php: 8.1 + - laravel: 13.* + php: 8.0 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..c2813f6 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,12 @@ ], "require": { "php": "^7.2|^8.0", - "illuminate/support": "^6.0|^7.0|^8.67|^9.0|^10.0|^11.0|^12.0", + "illuminate/support": "^6.0|^7.0|^8.67|^9.0|^10.0|^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": "^8.5.21|^9.0|^9.4.4|^10.5|^11.5.3|^12.5.12", + "orchestra/testbench": "^4.0|^5.0|^6.0|^8.0|^9.0|^10.0|^11.0" }, "autoload": { "psr-4": { From 13ac667157eb041a08681b41785f813cb8050958 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Sat, 21 Feb 2026 00:00:52 +0100 Subject: [PATCH 2/3] Update test expectations for current Google API responses --- tests/GeocoderTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/GeocoderTest.php b/tests/GeocoderTest.php index 60bf08d..1761a38 100644 --- a/tests/GeocoderTest.php +++ b/tests/GeocoderTest.php @@ -74,7 +74,7 @@ public function 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') @@ -88,13 +88,13 @@ public function 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 */ @@ -107,13 +107,13 @@ 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 */ @@ -139,7 +139,7 @@ public function it_should_prefer_a_neighborhood_inside_of_payload_bounds() ->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 */ From 2a71945a08ccd5f396e6364ba07179854f4cbeaf Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Sat, 21 Feb 2026 00:03:08 +0100 Subject: [PATCH 3/3] Drop old PHP/Laravel/PHPUnit versions, fix PHPUnit 12 compatibility - Require PHP 8.3+, Laravel 11+ - Update phpunit.xml.dist for PHPUnit 11/12 - Prefix test methods with test_ (PHPUnit 12 dropped @test annotation support) - Simplify CI matrix to PHP 8.3/8.4 with Laravel 11/12/13 --- .github/workflows/run-tests.yml | 25 ++----------------------- composer.json | 8 ++++---- phpunit.xml.dist | 6 +++--- tests/GeocoderTest.php | 26 +++++++++++++------------- 4 files changed, 22 insertions(+), 43 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index efd4bb2..fdbe76a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,37 +12,16 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: [8.4, 8.3, 8.2, 8.1, 8.0] - laravel: ['9.*', '10.*', '11.*', '12.*', '13.*'] + 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.* - laravel: 13.* testbench: 11.* - 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.* - php: 8.2 - - laravel: 13.* - php: 8.1 - - laravel: 13.* - php: 8.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index c2813f6..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|^13.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|^12.5.12", - "orchestra/testbench": "^4.0|^5.0|^6.0|^8.0|^9.0|^10.0|^11.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 1761a38..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,19 +58,19 @@ 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'); @@ -84,7 +84,7 @@ 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); @@ -98,7 +98,7 @@ public function it_can_translate_coordinates_to_an_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); @@ -117,7 +117,7 @@ public function it_can_translate_coordinates_to_multiple_addresses() } /** @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,7 +133,7 @@ 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') @@ -143,7 +143,7 @@ public function it_should_prefer_a_neighborhood_inside_of_payload_bounds() } /** @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());