From 06aa9d253e7d2bbebfadb987c5fd08e74769b872 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Tue, 8 Apr 2025 21:47:07 +0200 Subject: [PATCH 1/5] chore: add laravel 12 support --- .github/workflows/phpstan.yml | 15 ++++++--------- .github/workflows/pint.yml | 4 ++-- .github/workflows/tests.yml | 9 ++++----- .github/workflows/update-changelog.yml | 3 +++ composer.json | 14 +++++++------- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 6d7663f..ba7de4b 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -8,19 +8,16 @@ jobs: strategy: fail-fast: true matrix: - php: [8.1, 8.2] - laravel: [9.*, 10.*, 11.*] - dependency-version: [prefer-lowest, prefer-stable] + php: [8.2, 8.3] + laravel: [10.*, 11.*, 12.*] + dependency-version: [prefer-stable] include: + - laravel: 12.* + testbench: 10.* - laravel: 11.* testbench: 9.* - laravel: 10.* testbench: 8.* - - laravel: 9.* - testbench: 7.* - exclude: - - laravel: 11.* - php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: @@ -28,7 +25,7 @@ jobs: uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index 37ebb53..8ed196c 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -8,12 +8,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.3 extensions: json, dom, curl, libxml, mbstring coverage: none diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d9ca923..3b9781c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,17 +8,16 @@ jobs: strategy: fail-fast: true matrix: - php: [8.3, 8.2, 8.1] - laravel: [11.*, 10.*] + php: [8.3, 8.2] + laravel: [12.*, 11.*, 10.*] dependency-version: [prefer-stable] include: + - laravel: 12.* + testbench: 10.* - laravel: 11.* testbench: 9.* - laravel: 10.* testbench: 8.* - exclude: - - laravel: 11.* - php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 0cdea23..e09ead9 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -8,6 +8,9 @@ jobs: update: runs-on: ubuntu-latest + permissions: + contents: write + steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/composer.json b/composer.json index f4d6121..bcd3a35 100644 --- a/composer.json +++ b/composer.json @@ -31,11 +31,11 @@ } ], "require": { - "php": "^8.1", - "illuminate/console": "^10.0|^11.0", - "illuminate/container": "^10.0|^11.0", - "illuminate/database": "^10.0|^11.0", - "illuminate/support": "^10.0|^11.0", + "php": "^8.2", + "illuminate/console": "^10.0|^11.0|^12.0", + "illuminate/container": "^10.0|^11.0|^12.0", + "illuminate/database": "^10.0|^11.0|^12.0", + "illuminate/support": "^10.0|^11.0|^12.0", "spatie/eloquent-sortable": "^4.0.0", "spatie/laravel-package-tools": "^1.16", "spatie/laravel-sluggable": "^3.4.2", @@ -44,8 +44,8 @@ "require-dev": { "larastan/larastan": "^2.0", "laravel/pint": "^1.13", - "orchestra/testbench": "^8.0|^9.0", - "pestphp/pest": "^2.18", + "orchestra/testbench": "^8.0|^9.0|^10.0", + "pestphp/pest": "^2.18|^3.7", "spatie/test-time": "^1.3" }, "autoload": { From 7f1f813837242ff716552f5ed7b005af0916bcd9 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Tue, 8 Apr 2025 21:51:11 +0200 Subject: [PATCH 2/5] fix phpstan version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bcd3a35..40dc2ad 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "spatie/laravel-translatable": "^6.5.0" }, "require-dev": { - "larastan/larastan": "^2.0", + "larastan/larastan": "^2.0|^3.0", "laravel/pint": "^1.13", "orchestra/testbench": "^8.0|^9.0|^10.0", "pestphp/pest": "^2.18|^3.7", From d64125d3a8489cf6db55956e236bf9d88dd5a942 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Wed, 9 Apr 2025 08:08:32 +0200 Subject: [PATCH 3/5] fix tests --- tests/Feature/SubscribeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Feature/SubscribeTest.php b/tests/Feature/SubscribeTest.php index 88f326d..f79b3ba 100644 --- a/tests/Feature/SubscribeTest.php +++ b/tests/Feature/SubscribeTest.php @@ -16,7 +16,7 @@ }); it('User model implement subscription methods', function (): void { - expect($this->user) + expect(User::class) ->toHaveMethods([ 'activePlanSubscriptions', 'planSubscription', From 80e1111d9caa44cc2f0caa6e37723286b2da9b50 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Wed, 9 Apr 2025 08:10:36 +0200 Subject: [PATCH 4/5] chore: update dependencies --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 40dc2ad..f388834 100644 --- a/composer.json +++ b/composer.json @@ -42,10 +42,10 @@ "spatie/laravel-translatable": "^6.5.0" }, "require-dev": { - "larastan/larastan": "^2.0|^3.0", + "larastan/larastan": "^3.0", "laravel/pint": "^1.13", "orchestra/testbench": "^8.0|^9.0|^10.0", - "pestphp/pest": "^2.18|^3.7", + "pestphp/pest": "^3.7", "spatie/test-time": "^1.3" }, "autoload": { From e5e012473ad4ca46198e5deadfc1261f544db75f Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Wed, 9 Apr 2025 08:18:27 +0200 Subject: [PATCH 5/5] remove unsupported test --- .github/workflows/tests.yml | 5 +++++ composer.json | 4 ++-- tests/Feature/SubscribeTest.php | 12 ------------ 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b9781c..0f5c0a6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,6 +32,11 @@ jobs: tools: composer:v2 coverage: none + - name: Setup problem matchers + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Install Composer dependencies run: | composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update diff --git a/composer.json b/composer.json index f388834..40dc2ad 100644 --- a/composer.json +++ b/composer.json @@ -42,10 +42,10 @@ "spatie/laravel-translatable": "^6.5.0" }, "require-dev": { - "larastan/larastan": "^3.0", + "larastan/larastan": "^2.0|^3.0", "laravel/pint": "^1.13", "orchestra/testbench": "^8.0|^9.0|^10.0", - "pestphp/pest": "^3.7", + "pestphp/pest": "^2.18|^3.7", "spatie/test-time": "^1.3" }, "autoload": { diff --git a/tests/Feature/SubscribeTest.php b/tests/Feature/SubscribeTest.php index f79b3ba..740b68c 100644 --- a/tests/Feature/SubscribeTest.php +++ b/tests/Feature/SubscribeTest.php @@ -15,18 +15,6 @@ $this->plan = Plan::factory()->create(); }); -it('User model implement subscription methods', function (): void { - expect(User::class) - ->toHaveMethods([ - 'activePlanSubscriptions', - 'planSubscription', - 'planSubscriptions', - 'newPlanSubscription', - 'subscribedPlans', - 'subscribedTo', - ]); -}); - it('a user can subscribe to a plan', function (): void { $this->user->newPlanSubscription('main', $this->plan);