Skip to content

Commit

Permalink
Merge pull request #146 from Riley19280/laravel-11
Browse files Browse the repository at this point in the history
Support Laravel 11 development
  • Loading branch information
freekmurze authored Dec 9, 2024
2 parents f613d22 + 3588bc9 commit 9ab30fd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.0, 8.1, 8.2]
laravel: [10.*, 9.*]
laravel: [11.*, 10.*, 9.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 10.*
php: 8.0
- laravel: 11.*
php: 8.0
- laravel: 11.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand All @@ -41,7 +47,7 @@ jobs:
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:^2.64.1" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:^2.72.2" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
},
"require-dev": {
"mockery/mockery": "^1.5",
"orchestra/testbench": "^7.7|^8.0",
"pestphp/pest": "^1.22",
"phpunit/phpunit": "^9.5.24",
"spatie/pest-plugin-test-time": "^1.1"
"orchestra/testbench": "^7.7|^8.0|^9.0",
"pestphp/pest": "^1.22|^2",
"phpunit/phpunit": "^9.5.24|^10.5",
"spatie/pest-plugin-test-time": "^1.1|^2.2"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use function PHPUnit\Framework\assertStringContainsString;
use function PHPUnit\Framework\assertStringNotContainsString;
use Spatie\LaravelPackageTools\Commands\InstallCommand;
use Spatie\LaravelPackageTools\Package;

Expand Down Expand Up @@ -40,10 +41,18 @@ function restoreAppConfigFile(): void
->artisan('package-tools:install')
->assertSuccessful();

assertStringContainsString(
"App\Providers\MyPackageServiceProvider::class",
file_get_contents(base_path('config/app.php'))
);
if (intval(app()->version()) >= 11) {
// This does not happen in L11 because of the different framework skeleton
assertStringNotContainsString(
"App\Providers\MyPackageServiceProvider::class",
file_get_contents(base_path('config/app.php'))
);
} else {
assertStringContainsString(
"App\Providers\MyPackageServiceProvider::class",
file_get_contents(base_path('config/app.php'))
);
}

restoreAppConfigFile();
});

0 comments on commit 9ab30fd

Please sign in to comment.