Skip to content

Commit ac81948

Browse files
Laravel 12 Support (#19)
* update composer deps * update .gitignore * add new values to test matrix * bump carbon package in test workflow * bump testbench dep * bump pest * bump canvas in test workflow * bump larastan * bump phpstan plugins * migrate phpunit config * Fix Pest 4.x CI failures by removing coverage report config Pest 4.x/PHPUnit 12 exits with code 1 when coverage reports are configured but no driver is available. Removed the <coverage> section from phpunit.xml.dist since CI doesn't collect coverage anyway. Also updated test-coverage script to use Herd for local coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Bump minimum testbench 9.x version to fix L11 prefer-lowest Early testbench 9.x releases (v9.0.0) have a bug where $latestResponse property is referenced but doesn't exist. Bumping to ^9.6 avoids this. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix testbench version resolution for prefer-lowest The workflow now specifies the correct testbench version per Laravel version in the matrix, preventing prefer-lowest from trying to use testbench 8.x with Laravel 12. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Use bash shell for composer install on Windows The ^ character is a special escape char in Windows cmd and was being stripped from version constraints like ^10.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add PHP 8.5 to test matrix 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Exclude Laravel 10 from PHP 8.5 tests Laravel 10 doesn't support PHP 8.5. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Skip prefer-lowest for PHP 8.5 The older dependency versions installed by prefer-lowest aren't PHP 8.5 compatible yet (testbench/PHPUnit error handler issues). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add comment explaining PHP 8.5 prefer-lowest exclusion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1a445d9 commit ac81948

File tree

5 files changed

+77
-46
lines changed

5 files changed

+77
-46
lines changed

.github/workflows/run-tests.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,32 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [macos-latest, ubuntu-latest, windows-latest]
16-
php: [8.3, 8.2, 8.1]
17-
laravel: [11.*, 10.*]
16+
php: [8.5, 8.4, 8.3, 8.2, 8.1]
17+
laravel: [12.*, 11.*, 10.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20+
- laravel: 12.*
21+
testbench: ^10.0
22+
canvas: ^10.0
23+
carbon: 3.*
2024
- laravel: 11.*
25+
testbench: ^9.6
2126
canvas: 9.*
2227
carbon: 2.*
2328
- laravel: 10.*
29+
testbench: ^8.11
2430
canvas: ^8.11
2531
carbon: 2.*
2632
exclude:
33+
- laravel: 12.*
34+
php: 8.1
2735
- laravel: 11.*
2836
php: 8.1
37+
- laravel: 10.*
38+
php: 8.5
39+
# prefer-lowest installs old dependency versions that aren't PHP 8.5 compatible yet
40+
- php: 8.5
41+
stability: prefer-lowest
2942

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

@@ -46,8 +59,9 @@ jobs:
4659
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
4760
4861
- name: Install dependencies
62+
shell: bash
4963
run: |
50-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/canvas:${{ matrix.canvas }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
64+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "orchestra/canvas:${{ matrix.canvas }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
5165
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
5266
5367
- name: List Installed Dependencies

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea
22
.phpunit.cache
3+
.DS_Store
34
build
45
composer.lock
56
coverage

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
"require": {
1919
"php": "^8.1",
2020
"spatie/laravel-package-tools": "^1.14.0",
21-
"illuminate/contracts": "^10.0|^11.0"
21+
"illuminate/contracts": "^10.0|^11.0|^12.0"
2222
},
2323
"require-dev": {
24-
"larastan/larastan": "^2.9",
24+
"larastan/larastan": "^2.9|^3.0",
2525
"laravel/pint": "^1.0",
2626
"nunomaduro/collision": "^7.0|^8.0",
27-
"orchestra/testbench": "^8.11|^9.0",
28-
"pestphp/pest": "^2.0",
29-
"pestphp/pest-plugin-arch": "^2.0",
30-
"pestphp/pest-plugin-laravel": "^2.0",
27+
"orchestra/testbench": "^8.11|^9.6|^10.0",
28+
"pestphp/pest": "^2.0|^3.0|^4.0",
29+
"pestphp/pest-plugin-arch": "^2.0|^3.0|^4.0",
30+
"pestphp/pest-plugin-laravel": "^2.0|^3.0|^4.0",
3131
"phpstan/extension-installer": "^1.1",
32-
"phpstan/phpstan-deprecation-rules": "^1.0",
33-
"phpstan/phpstan-phpunit": "^1.0"
32+
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
33+
"phpstan/phpstan-phpunit": "^1.0|^2.0"
3434
},
3535
"autoload": {
3636
"psr-4": {
@@ -46,7 +46,7 @@
4646
"post-autoload-dump": "@php ./vendor/bin/testbench package:discover --ansi",
4747
"analyse": "vendor/bin/phpstan analyse",
4848
"test": "vendor/bin/pest",
49-
"test-coverage": "vendor/bin/pest --coverage",
49+
"test-coverage": "XDEBUG_MODE=coverage herd debug ./vendor/bin/pest --coverage",
5050
"lint": "vendor/bin/pint"
5151
},
5252
"config": {

phpunit.xml.dist

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
5-
backupGlobals="false"
6-
bootstrap="vendor/autoload.php"
7-
colors="true"
8-
processIsolation="false"
9-
stopOnFailure="false"
10-
executionOrder="random"
11-
failOnWarning="true"
12-
failOnRisky="true"
13-
failOnEmptyTestSuite="true"
14-
beStrictAboutOutputDuringTests="true"
15-
cacheDirectory=".phpunit.cache"
16-
backupStaticProperties="false"
17-
>
18-
<testsuites>
19-
<testsuite name="ProjektGopher Test Suite">
20-
<directory>tests</directory>
21-
</testsuite>
22-
</testsuites>
23-
<coverage>
24-
<include>
25-
<directory suffix=".php">./src</directory>
26-
</include>
27-
<report>
28-
<html outputDirectory="build/coverage"/>
29-
<text outputFile="build/coverage.txt"/>
30-
<clover outputFile="build/logs/clover.xml"/>
31-
</report>
32-
</coverage>
33-
<logging>
34-
<junit outputFile="build/report.junit.xml"/>
35-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuites>
4+
<testsuite name="ProjektGopher Test Suite">
5+
<directory>tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<logging>
9+
<junit outputFile="build/report.junit.xml"/>
10+
</logging>
11+
<source>
12+
<include>
13+
<directory suffix=".php">./src</directory>
14+
</include>
15+
</source>
3616
</phpunit>

phpunit.xml.dist.bak

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
5+
backupGlobals="false"
6+
bootstrap="vendor/autoload.php"
7+
colors="true"
8+
processIsolation="false"
9+
stopOnFailure="false"
10+
executionOrder="random"
11+
failOnWarning="true"
12+
failOnRisky="true"
13+
failOnEmptyTestSuite="true"
14+
beStrictAboutOutputDuringTests="true"
15+
cacheDirectory=".phpunit.cache"
16+
backupStaticProperties="false"
17+
>
18+
<testsuites>
19+
<testsuite name="ProjektGopher Test Suite">
20+
<directory>tests</directory>
21+
</testsuite>
22+
</testsuites>
23+
<coverage>
24+
<include>
25+
<directory suffix=".php">./src</directory>
26+
</include>
27+
<report>
28+
<html outputDirectory="build/coverage"/>
29+
<text outputFile="build/coverage.txt"/>
30+
<clover outputFile="build/logs/clover.xml"/>
31+
</report>
32+
</coverage>
33+
<logging>
34+
<junit outputFile="build/report.junit.xml"/>
35+
</logging>
36+
</phpunit>

0 commit comments

Comments
 (0)