From 9a026a4cd87c9a2282ff9371c27efea16634a238 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Mon, 3 Mar 2025 20:05:04 +0000 Subject: [PATCH] feat!: upgrade to Laravel 11 --- .github/workflows/tests.yml | 60 +++++++++++++++++++---------------- .gitignore | 2 +- CHANGELOG.md | 7 ++++ composer.json | 14 ++++---- phpunit.xml | 47 ++++++--------------------- tests/lib/Acceptance/Test.php | 2 +- 6 files changed, 58 insertions(+), 74 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4e87f8a..092bde6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,9 +2,13 @@ name: Tests on: push: - branches: [ main, develop ] + branches: + - main + - develop pull_request: - branches: [ main, develop ] + branches: + - main + - develop jobs: build: @@ -14,31 +18,31 @@ jobs: strategy: fail-fast: true matrix: - php: [8.1, 8.2] - laravel: [10] + php: [ 8.2, 8.3, 8.4 ] + laravel: [ 11 ] steps: - - name: Checkout Code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd - tools: composer:v2 - coverage: none - ini-values: error_reporting=E_ALL, zend.assertions=1 - - - name: Set Laravel Version - run: composer require "laravel/framework:^${{ matrix.laravel }}" --no-update -n - - - name: Install dependencies - uses: nick-fields/retry@v2 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer install --no-suggest --prefer-dist -n -o - - - name: Execute tests - run: vendor/bin/phpunit + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd + tools: composer:v2 + coverage: none + ini-values: error_reporting=E_ALL, zend.assertions=1 + + - name: Set Laravel Version + run: composer require "illuminate/support:^${{ matrix.laravel }}" --no-update + + - name: Install dependencies + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3d7e132..d0757eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ vendor/ composer.lock -.phpunit.result.cache +.phpunit.cache/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 65394d5..663e31f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/). +## Unreleased + +### Changed + +- Minimum PHP is now 8.2. +- Minimum Laravel is now 11. + ## [2.0.0] - 2023-06-20 ### Changed diff --git a/composer.json b/composer.json index df73100..7e1f6a3 100644 --- a/composer.json +++ b/composer.json @@ -23,14 +23,14 @@ } ], "require": { - "php": "^8.1", - "illuminate/support": "^10.0", - "laravel-json-api/eloquent": "^3.0", - "tenantcloud/laravel-boolean-softdeletes": "^5.0" + "php": "^8.2", + "illuminate/support": "^11.0", + "laravel-json-api/eloquent": "^4.0", + "tenantcloud/laravel-boolean-softdeletes": "^6.0" }, "require-dev": { - "orchestra/testbench": "^8.0", - "phpunit/phpunit": "^9.6.9" + "orchestra/testbench": "^9.0", + "phpunit/phpunit": "^10.5" }, "autoload": { "psr-4": { @@ -46,7 +46,7 @@ }, "extra": { "branch-alias": { - "dev-develop": "2.x-dev" + "dev-develop": "3.x-dev" } }, "minimum-stability": "stable", diff --git a/phpunit.xml b/phpunit.xml index c5ad631..c6c5378 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,41 +1,9 @@ - - - - - - src/ - - + ./tests/lib/Unit/ @@ -51,4 +19,9 @@ + + + src/ + + diff --git a/tests/lib/Acceptance/Test.php b/tests/lib/Acceptance/Test.php index bbccb75..84397d6 100644 --- a/tests/lib/Acceptance/Test.php +++ b/tests/lib/Acceptance/Test.php @@ -43,7 +43,7 @@ protected function setUp(): void /** * @return array */ - public function trashedProvider(): array + public static function trashedProvider(): array { return [ 'trashed' => [true],