Skip to content

Commit 19f1ece

Browse files
freekmurzeclaude
andcommitted
Upgrade test tooling to support PHP 8.2-8.5
- Bump minimum PHP to ^8.2 (8.0 and 8.1 are EOL) - Upgrade from Pest v1 to Pest v3 - Upgrade from PHPUnit 9 to PHPUnit 11 - Replace Prophecy with Mockery for mocking - Update phpunit.xml.dist for PHPUnit 11 - Update GitHub Actions workflow for PHP 8.2-8.5 - Update checkout action to v4 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent be4192b commit 19f1ece

File tree

5 files changed

+140
-120
lines changed

5 files changed

+140
-120
lines changed

.github/workflows/run-tests.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
name: Tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
48

59
jobs:
610
test:
7-
runs-on: ${{ matrix.os }}
11+
runs-on: ubuntu-latest
12+
813
strategy:
914
fail-fast: true
1015
matrix:
11-
os: [ubuntu-latest]
12-
php: [8.2, 8.1, 8.0]
16+
php: ['8.2', '8.3', '8.4', '8.5']
1317
dependency-version: [prefer-lowest, prefer-stable]
1418

15-
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
19+
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
1620

1721
steps:
1822
- name: Checkout code
19-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2024

2125
- name: Setup PHP
2226
uses: shivammathur/setup-php@v2
2327
with:
2428
php-version: ${{ matrix.php }}
25-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
2629
coverage: none
2730

28-
- name: Setup Problem Matches
29-
run: |
30-
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
31-
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
32-
3331
- name: Install dependencies
3432
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
3533

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
}
2121
],
2222
"require": {
23-
"php": "^8.0",
23+
"php": "^8.2",
2424
"league/flysystem": "^3.7.0",
2525
"spatie/dropbox-api": "^1.17.1"
2626
},
2727
"require-dev": {
28-
"pestphp/pest": "^1.22",
29-
"phpspec/prophecy-phpunit": "^2.0.1",
30-
"phpunit/phpunit": "^9.5.4"
28+
"mockery/mockery": "^1.6",
29+
"pestphp/pest": "^3.0",
30+
"phpunit/phpunit": "^11.0"
3131
},
3232
"autoload": {
3333
"psr-4": {
@@ -40,7 +40,7 @@
4040
}
4141
},
4242
"scripts": {
43-
"test": "vendor/bin/phpunit"
43+
"test": "vendor/bin/pest"
4444
},
4545
"config": {
4646
"sort-packages": true,

phpunit.xml.dist

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage>
4-
<include>
5-
<directory suffix=".php">src/</directory>
6-
</include>
7-
<report>
8-
<clover outputFile="build/logs/clover.xml"/>
9-
<html outputDirectory="build/coverage"/>
10-
<text outputFile="build/coverage.txt"/>
11-
</report>
12-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
>
137
<testsuites>
148
<testsuite name="Spatie Test Suite">
159
<directory>tests</directory>
1610
</testsuite>
1711
</testsuites>
18-
<logging>
19-
<junit outputFile="build/report.junit.xml"/>
20-
</logging>
12+
<source>
13+
<include>
14+
<directory suffix=".php">src/</directory>
15+
</include>
16+
</source>
2117
</phpunit>

0 commit comments

Comments
 (0)