From 81757e0b87842b9a0284205436acab561ae4d755 Mon Sep 17 00:00:00 2001 From: Ed Hanton <104428735+ed-hanton-swytch@users.noreply.github.com> Date: Tue, 13 Jun 2023 15:31:12 +0100 Subject: [PATCH] Support laravel 10 (#29) * Support laravel 10 * Update tests for laravel 10 * Update README.md for Laravel 10 * Only support supported laravel versions (8-10) * upgrade phpunit * Fix tests as per test-bench upgrade guide * upgrade minimum php version --- .github/workflows/test.yml | 44 +++++++------------ README.md | 2 +- composer.json | 12 ++--- tests/Facades/UpsAddressValidationTest.php | 6 +-- tests/Facades/UpsLocatorTest.php | 6 +-- tests/Facades/UpsQuantumViewTest.php | 6 +-- tests/Facades/UpsRateTest.php | 6 +-- tests/Facades/UpsRateTimeInTransitTest.php | 6 +-- tests/Facades/UpsShippingTest.php | 6 +-- .../UpsSimpleAddressValidationTest.php | 6 +-- tests/Facades/UpsTimeInTransitTest.php | 6 +-- tests/Facades/UpsTrackingTest.php | 6 +-- tests/Facades/UpsTradeabilityTest.php | 6 +-- tests/TestCase.php | 2 +- 14 files changed, 53 insertions(+), 67 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5de0810..13c6541 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,21 +11,15 @@ jobs: strategy: matrix: - php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ] - laravel: [ '6', '7', '8', '9' ] + php: [ '7.4', '8.0', '8.1' ] + laravel: [ '8', '9', '10' ] exclude: - - php: '7.2' - laravel: '8' - - php: '7.2' - laravel: '9' - - php: '7.3' - laravel: '9' - php: '7.4' laravel: '9' - - php: '8.1' - laravel: '6' - - php: '8.1' - laravel: '7' + - php: '7.4' + laravel: '10' + - php: '8.0' + laravel: '10' steps: - name: Checkout Code @@ -41,22 +35,6 @@ jobs: - name: Setup Problem Matchers run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Select Laravel 6 - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require "laravel/framework:6.*" --no-update --no-interaction - if: "matrix.laravel == '6'" - - - name: Select Laravel 7 - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require "laravel/framework:7.*" --no-update --no-interaction - if: "matrix.laravel == '7'" - - name: Select Laravel 8 uses: nick-invision/retry@v1 with: @@ -72,6 +50,14 @@ jobs: max_attempts: 5 command: composer require "laravel/framework:9.*" --no-update --no-interaction if: "matrix.laravel == '9'" + + - name: Select Laravel 10 + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require "laravel/framework:10.*" --no-update --no-interaction + if: "matrix.laravel == '10'" - name: Install PHP Dependencies uses: nick-invision/retry@v1 @@ -81,4 +67,4 @@ jobs: command: composer update --no-interaction --no-progress - name: Execute PHPUnit - run: vendor/bin/phpunit \ No newline at end of file + run: vendor/bin/phpunit diff --git a/README.md b/README.md index f546629..6001f18 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Laravel UPS Api ================= -## For Laravel 6, 7, 8 and 9 +## For Laravel 8, 9 and 10

Build Status diff --git a/composer.json b/composer.json index a3b862c..f68e909 100644 --- a/composer.json +++ b/composer.json @@ -3,15 +3,15 @@ "description": "A small Laravel's wrapper for the PHP UPS API library", "keywords": ["laravel", "framework", "UPS", "Laravel UPS Api", "Laravel-Ups-Api", "Pierre Tondereau", "Ptondereau"], "require": { - "php": "^7.2.5 || ^8.0", - "illuminate/contracts": "^6.0 || ^7.0 || ^8.0 || ^9.0", - "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "php": "^7.4.15 || ^8.0", + "illuminate/contracts": "^8.0 || ^9.0 || ^10.0", + "illuminate/support": "^8.0 || ^9.0 || ^10.0", "gabrielbull/ups-api": "^1.2.2 || ^2.0" }, "require-dev": { - "graham-campbell/analyzer": "^3.0", - "graham-campbell/testbench": "^5.7", - "phpunit/phpunit": "^8.5.8 || ^9.3.7" + "graham-campbell/analyzer": "^4.0", + "graham-campbell/testbench": "^6.0", + "phpunit/phpunit": "^9.3.7" }, "autoload": { "psr-4": { diff --git a/tests/Facades/UpsAddressValidationTest.php b/tests/Facades/UpsAddressValidationTest.php index 24bd89c..e7704a4 100644 --- a/tests/Facades/UpsAddressValidationTest.php +++ b/tests/Facades/UpsAddressValidationTest.php @@ -16,17 +16,17 @@ class UpsAddressValidationTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.address-validation'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsAddressValidation::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return AddressValidation::class; } diff --git a/tests/Facades/UpsLocatorTest.php b/tests/Facades/UpsLocatorTest.php index 7350eb2..055582c 100644 --- a/tests/Facades/UpsLocatorTest.php +++ b/tests/Facades/UpsLocatorTest.php @@ -16,17 +16,17 @@ class UpsLocatorTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.locator'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsLocator::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Locator::class; } diff --git a/tests/Facades/UpsQuantumViewTest.php b/tests/Facades/UpsQuantumViewTest.php index 044e81a..2b84e2a 100644 --- a/tests/Facades/UpsQuantumViewTest.php +++ b/tests/Facades/UpsQuantumViewTest.php @@ -16,17 +16,17 @@ class UpsQuantumViewTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.quantum-view'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsQuantumView::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return QuantumView::class; } diff --git a/tests/Facades/UpsRateTest.php b/tests/Facades/UpsRateTest.php index f291160..62e5235 100644 --- a/tests/Facades/UpsRateTest.php +++ b/tests/Facades/UpsRateTest.php @@ -16,17 +16,17 @@ class UpsRateTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.rate'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsRate::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Rate::class; } diff --git a/tests/Facades/UpsRateTimeInTransitTest.php b/tests/Facades/UpsRateTimeInTransitTest.php index 09a0774..ee25444 100644 --- a/tests/Facades/UpsRateTimeInTransitTest.php +++ b/tests/Facades/UpsRateTimeInTransitTest.php @@ -16,17 +16,17 @@ class UpsRateTimeInTransitTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.ratetimeintransit'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsRateTimeInTransit::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return RateTimeInTransit::class; } diff --git a/tests/Facades/UpsShippingTest.php b/tests/Facades/UpsShippingTest.php index c5e4dfd..ed993a3 100644 --- a/tests/Facades/UpsShippingTest.php +++ b/tests/Facades/UpsShippingTest.php @@ -16,17 +16,17 @@ class UpsShippingTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.shipping'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsShipping::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Shipping::class; } diff --git a/tests/Facades/UpsSimpleAddressValidationTest.php b/tests/Facades/UpsSimpleAddressValidationTest.php index ee05896..dc8c4a3 100644 --- a/tests/Facades/UpsSimpleAddressValidationTest.php +++ b/tests/Facades/UpsSimpleAddressValidationTest.php @@ -16,17 +16,17 @@ class UpsSimpleAddressValidationTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.simple-address-validation'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsSimpleAddressValidation::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return SimpleAddressValidation::class; } diff --git a/tests/Facades/UpsTimeInTransitTest.php b/tests/Facades/UpsTimeInTransitTest.php index c077c50..4b9a485 100644 --- a/tests/Facades/UpsTimeInTransitTest.php +++ b/tests/Facades/UpsTimeInTransitTest.php @@ -16,17 +16,17 @@ class UpsTimeInTransitTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.time-in-transit'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsTimeInTransit::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return TimeInTransit::class; } diff --git a/tests/Facades/UpsTrackingTest.php b/tests/Facades/UpsTrackingTest.php index 53bab76..eaedcf2 100644 --- a/tests/Facades/UpsTrackingTest.php +++ b/tests/Facades/UpsTrackingTest.php @@ -16,17 +16,17 @@ class UpsTrackingTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.tracking'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsTracking::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Tracking::class; } diff --git a/tests/Facades/UpsTradeabilityTest.php b/tests/Facades/UpsTradeabilityTest.php index e910dbf..8c813e9 100644 --- a/tests/Facades/UpsTradeabilityTest.php +++ b/tests/Facades/UpsTradeabilityTest.php @@ -16,17 +16,17 @@ class UpsTradeabilityTest extends TestCase { use FacadeTrait; - protected function getFacadeAccessor(): string + protected static function getFacadeAccessor(): string { return 'ups.tradeability'; } - protected function getFacadeClass(): string + protected static function getFacadeClass(): string { return UpsTradeability::class; } - protected function getFacadeRoot(): string + protected static function getFacadeRoot(): string { return Tradeability::class; } diff --git a/tests/TestCase.php b/tests/TestCase.php index f553ad4..138c8c9 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -17,7 +17,7 @@ abstract class TestCase extends AbstractPackageTestCase * * @return string */ - protected function getServiceProviderClass(): string + protected static function getServiceProviderClass(): string { return UpsApiServiceProvider::class; }