Skip to content

Commit d92cb86

Browse files
committed
Split testing for different PHPUnit versions
1 parent 3182f14 commit d92cb86

File tree

5 files changed

+94
-19
lines changed

5 files changed

+94
-19
lines changed

.github/workflows/test.yml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ jobs:
1616
fail-fast: true
1717
matrix:
1818
php: [ 8.4, 8.3, 8.2, 8.1 ]
19-
laravel: [ '8.*', '9.*', '10.*', '11.*', '12.*' ]
19+
laravel: [ '10.*', '11.*', '12.*' ]
2020
include:
2121
- laravel: 10.*
2222
testbench: 8.*
23-
- laravel: 9.*
24-
testbench: 7.*
25-
- laravel: 8.*
26-
testbench: 6.*
2723
- laravel: 11.*
2824
testbench: 9.*
2925
- laravel: 12.*
@@ -50,4 +46,39 @@ jobs:
5046
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
5147
5248
- name: Execute tests
53-
run: vendor/bin/phpunit
49+
run: vendor/bin/phpunit -c phpunit.xml.dist
50+
51+
test-legacy:
52+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
53+
54+
runs-on: ubuntu-latest
55+
56+
strategy:
57+
fail-fast: true
58+
matrix:
59+
php: [ 8.4, 8.3, 8.2, 8.1 ]
60+
laravel: [ '8.*', '9.*' ]
61+
include:
62+
- laravel: 8.*
63+
testbench: 6.*
64+
- laravel: 9.*
65+
testbench: 7.*
66+
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v2
70+
71+
- name: Set correct PHP version
72+
uses: shivammathur/setup-php@v2
73+
with:
74+
php-version: ${{ matrix.php }}
75+
coverage: pcov
76+
77+
- name: Install dependencies
78+
run: |
79+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
80+
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
81+
82+
- name: Execute tests
83+
run: vendor/bin/phpunit -c phpunit.xml.legacy.dist
84+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.phpunit.cache
12
/vendor
23
build
34
.phpunit.result.cache

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
"email": "mail@casperboone.nl",
1010
"homepage": "https://casperboone.nl",
1111
"role": "Developer"
12+
},
13+
{
14+
"name": "Kevin Woblick",
15+
"email": "contact@woblick.dev",
16+
"homepage": "https://woblick.dev",
17+
"role": "Developer"
1218
}
1319
],
1420
"require": {
@@ -20,7 +26,7 @@
2026
"require-dev": {
2127
"mockery/mockery": "^1.3.1",
2228
"phpunit/phpunit": "^9.3 || ^10.5 || ^11.5.3",
23-
"orchestra/testbench": "^8.0 || ^9.0 || ^10.0"
29+
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0"
2430
},
2531
"suggest": {
2632
"ext-exif": "Required for image attachment support"

phpunit.xml.dist

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
executionOrder="depends,defects"
7+
shortenArraysForExportThreshold="10"
8+
beStrictAboutOutputDuringTests="true"
9+
displayDetailsOnPhpunitDeprecations="true"
10+
failOnPhpunitDeprecation="false"
11+
failOnWarning="false"
12+
failOnRisky="true">
13+
1214
<testsuites>
1315
<testsuite name="Laravel Pushover Notifications Test Suite">
1416
<directory>tests</directory>
1517
</testsuite>
1618
</testsuites>
17-
<coverage>
19+
20+
<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
1821
<include>
19-
<directory suffix=".php">./src</directory>
22+
<directory>src</directory>
2023
</include>
24+
</source>
25+
26+
<coverage>
2127
<report>
2228
<html outputDirectory="build/coverage"/>
2329
<text outputFile="build/coverage.txt"/>
2430
<clover outputFile="build/logs/clover.xml"/>
2531
</report>
2632
</coverage>
33+
2734
<logging>
2835
<junit outputFile="build/report.junit.xml"/>
2936
</logging>

phpunit.xml.legacy.dist

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Laravel Pushover Notifications Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<coverage>
18+
<include>
19+
<directory suffix=".php">./src</directory>
20+
</include>
21+
<report>
22+
<html outputDirectory="build/coverage"/>
23+
<text outputFile="build/coverage.txt"/>
24+
<clover outputFile="build/logs/clover.xml"/>
25+
</report>
26+
</coverage>
27+
<logging>
28+
<junit outputFile="build/report.junit.xml"/>
29+
</logging>
30+
</phpunit>

0 commit comments

Comments
 (0)