Skip to content

Commit 85275e2

Browse files
committed
chore: migrate phpunit configuration
chore: drop support below Laravel 9
1 parent b2c23ee commit 85275e2

File tree

5 files changed

+88
-34
lines changed

5 files changed

+88
-34
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
os: [ubuntu-latest]
14+
php: [8.0, 8.1, 8.2, 8.3]
15+
laravel: [9.*, 10.*, 11.*]
16+
dependency-version: [prefer-lowest, prefer-stable]
17+
exclude:
18+
- laravel: 9.*
19+
php: [8.1, 8.2, 8.3]
20+
- laravel: 11.*
21+
php: 8.1
22+
23+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php }}
33+
extensions: dom, curl, libxml, mbstring, zip
34+
tools: composer:v2
35+
coverage: none
36+
37+
- name: Install dependencies
38+
run: |
39+
composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/mail:${{ matrix.laravel }}" "illuminate/view:${{ matrix.laravel }}" --no-interaction --no-update
40+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress
41+
- name: Execute tests
42+
run: vendor/bin/pest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ docs
44
vendor
55
coverage
66
.phpunit.result.cache
7+
.phpunit.cache
78
.idea

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ php:
55
- 7.4
66
- 8.0
77
- 8.1
8+
- 8.2
89

910
env:
1011
matrix:

composer.json

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
22
"name": "beyondcode/helo-laravel",
33
"description": "HELO Laravel debug helper",
4+
"license": "MIT",
45
"keywords": [
56
"beyondcode",
67
"HELO"
78
],
8-
"homepage": "https://github.com/beyondcode/helo-laravel",
9-
"license": "MIT",
109
"authors": [
1110
{
1211
"name": "Marcel Pociot",
@@ -15,17 +14,18 @@
1514
"role": "Developer"
1615
}
1716
],
17+
"homepage": "https://github.com/beyondcode/helo-laravel",
1818
"require": {
19-
"php": "^7.3|^8.0",
20-
"illuminate/view": "^6.0|^7.0|^8.0|^9.0|^10.0",
21-
"illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0",
22-
"illuminate/mail": "^6.0|^7.0|^8.0|^9.0|^10.0"
19+
"php": "^8.0 || ^8.1",
20+
"illuminate/console": "^9.0 || ^10.0 || ^11.0",
21+
"illuminate/mail": "^9.0 || ^10.0 || ^11.0",
22+
"illuminate/view": "^9.0 || ^10.0 || ^11.0"
2323
},
2424
"require-dev": {
25-
"orchestra/testbench": "^5.1|^6.3|^7.0|^8.0",
26-
"pestphp/pest": "1.x-dev",
27-
"phpunit/phpunit": "^8.0|^9.0"
25+
"orchestra/testbench": "^5.1 || ^6.3 || ^7.0 || ^8.0",
26+
"pestphp/pest": "1.x-dev || 2.x-dev"
2827
},
28+
"minimum-stability": "dev",
2929
"autoload": {
3030
"psr-4": {
3131
"BeyondCode\\HeloLaravel\\": "src"
@@ -36,22 +36,24 @@
3636
"BeyondCode\\HeloLaravel\\Tests\\": "tests"
3737
}
3838
},
39-
"scripts": {
40-
"test": "vendor/bin/phpunit",
41-
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
42-
},
4339
"config": {
44-
"sort-packages": true,
4540
"allow-plugins": {
4641
"pestphp/pest-plugin": true
47-
}
42+
},
43+
"sort-packages": true
4844
},
49-
"minimum-stability": "dev",
5045
"extra": {
46+
"branch-alias": {
47+
"dev-master": "11.x-dev"
48+
},
5149
"laravel": {
5250
"providers": [
5351
"BeyondCode\\HeloLaravel\\HeloLaravelServiceProvider"
5452
]
5553
}
54+
},
55+
"scripts": {
56+
"test": "vendor/bin/phpunit",
57+
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
5658
}
5759
}

phpunit.xml.dist

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
executionOrder="depends,defects"
7+
beStrictAboutCoverageMetadata="true"
8+
beStrictAboutOutputDuringTests="true"
59
colors="true"
6-
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
10+
backupGlobals="false"
11+
backupStaticProperties="false"
12+
stopOnError="false"
1113
stopOnFailure="false">
1214
<testsuites>
1315
<testsuite name="BeyondCode Test Suite">
1416
<directory>tests</directory>
1517
</testsuite>
1618
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory suffix=".php">src/</directory>
20-
</whitelist>
21-
</filter>
19+
20+
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
21+
<include>
22+
<directory>src</directory>
23+
</include>
24+
</source>
25+
2226
<logging>
23-
<log type="tap" target="build/report.tap"/>
24-
<log type="junit" target="build/report.junit.xml"/>
25-
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
26-
<log type="coverage-text" target="build/coverage.txt"/>
27-
<log type="coverage-clover" target="build/logs/clover.xml"/>
27+
<junit outputFile="build/report.junit.xml"/>
2828
</logging>
29+
30+
<coverage>
31+
<report>
32+
<html outputDirectory="build/html-coverage" />
33+
<text outputFile="build/coverage.txt" />
34+
<clover outputFile="build/clover.xml" />
35+
</report>
36+
</coverage>
2937
</phpunit>

0 commit comments

Comments
 (0)