Skip to content

Commit

Permalink
Support laravel 10 (#29)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ed-hanton-swytch authored Jun 13, 2023
1 parent b08bf09 commit 81757e0
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 67 deletions.
44 changes: 15 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -81,4 +67,4 @@ jobs:
command: composer update --no-interaction --no-progress

- name: Execute PHPUnit
run: vendor/bin/phpunit
run: vendor/bin/phpunit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Laravel UPS Api
=================

## For Laravel 6, 7, 8 and 9
## For Laravel 8, 9 and 10

<p align="center">
<a href="https://github.com/ptondereau/Laravel-UPS-Api/actions?query=workflow%3ATests"><img src="https://img.shields.io/github/workflow/status/ptondereau/Laravel-UPS-Api/Tests?label=Tests&style=flat-square" alt="Build Status"/></a>
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsAddressValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsQuantumViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsRateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsRateTimeInTransitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsShippingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsSimpleAddressValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsTimeInTransitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsTrackingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Facades/UpsTradeabilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract class TestCase extends AbstractPackageTestCase
*
* @return string
*/
protected function getServiceProviderClass(): string
protected static function getServiceProviderClass(): string
{
return UpsApiServiceProvider::class;
}
Expand Down

0 comments on commit 81757e0

Please sign in to comment.