Skip to content

Commit 9ab30fd

Browse files
authored
Merge pull request #146 from Riley19280/laravel-11
Support Laravel 11 development
2 parents f613d22 + 3588bc9 commit 9ab30fd

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

.github/workflows/run-tests.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,22 @@ jobs:
1010
matrix:
1111
os: [ubuntu-latest, windows-latest]
1212
php: [8.0, 8.1, 8.2]
13-
laravel: [10.*, 9.*]
13+
laravel: [11.*, 10.*, 9.*]
1414
stability: [prefer-lowest, prefer-stable]
1515
include:
1616
- laravel: 9.*
1717
testbench: 7.*
1818
- laravel: 10.*
1919
testbench: 8.*
20+
- laravel: 11.*
21+
testbench: 9.*
2022
exclude:
2123
- laravel: 10.*
2224
php: 8.0
25+
- laravel: 11.*
26+
php: 8.0
27+
- laravel: 11.*
28+
php: 8.1
2329

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

@@ -41,7 +47,7 @@ jobs:
4147
4248
- name: Install dependencies
4349
run: |
44-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:^2.64.1" --no-interaction --no-update
50+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:^2.72.2" --no-interaction --no-update
4551
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4652
4753
- name: Execute tests

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
},
2121
"require-dev": {
2222
"mockery/mockery": "^1.5",
23-
"orchestra/testbench": "^7.7|^8.0",
24-
"pestphp/pest": "^1.22",
25-
"phpunit/phpunit": "^9.5.24",
26-
"spatie/pest-plugin-test-time": "^1.1"
23+
"orchestra/testbench": "^7.7|^8.0|^9.0",
24+
"pestphp/pest": "^1.22|^2",
25+
"phpunit/phpunit": "^9.5.24|^10.5",
26+
"spatie/pest-plugin-test-time": "^1.1|^2.2"
2727
},
2828
"autoload": {
2929
"psr-4": {

tests/PackageServiceProviderTests/InstallCommandTests/CopyAndRegisterServiceProviderInAppTest.php

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use function PHPUnit\Framework\assertStringContainsString;
4+
use function PHPUnit\Framework\assertStringNotContainsString;
45
use Spatie\LaravelPackageTools\Commands\InstallCommand;
56
use Spatie\LaravelPackageTools\Package;
67

@@ -40,10 +41,18 @@ function restoreAppConfigFile(): void
4041
->artisan('package-tools:install')
4142
->assertSuccessful();
4243

43-
assertStringContainsString(
44-
"App\Providers\MyPackageServiceProvider::class",
45-
file_get_contents(base_path('config/app.php'))
46-
);
44+
if (intval(app()->version()) >= 11) {
45+
// This does not happen in L11 because of the different framework skeleton
46+
assertStringNotContainsString(
47+
"App\Providers\MyPackageServiceProvider::class",
48+
file_get_contents(base_path('config/app.php'))
49+
);
50+
} else {
51+
assertStringContainsString(
52+
"App\Providers\MyPackageServiceProvider::class",
53+
file_get_contents(base_path('config/app.php'))
54+
);
55+
}
4756

4857
restoreAppConfigFile();
4958
});

0 commit comments

Comments
 (0)