Skip to content

Commit 242ff78

Browse files
authored
Upgrade to PHPUnit 10 (#32)
1 parent 0e8a6cf commit 242ff78

File tree

9 files changed

+130
-221
lines changed

9 files changed

+130
-221
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
version: 2
22

33
updates:
4-
54
- package-ecosystem: "composer"
65
directory: "/"
76
schedule:
87
interval: "weekly"
9-
commit-message:
10-
include: "scope"
11-
prefix: "composer"
12-
labels:
13-
- "enhancement"
148
versioning-strategy: "widen"
159

1610
- package-ecosystem: "github-actions"
1711
directory: "/"
1812
schedule:
1913
interval: "weekly"
20-
commit-message:
21-
include: "scope"
22-
prefix: "github-actions"
23-
labels:
24-
- "enhancement"

.github/workflows/ci.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: "CI"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
9+
env:
10+
INI_VALUES: zend.assertions=1,error_reporting=-1
11+
12+
jobs:
13+
composer-json-lint:
14+
name: "Lint composer.json"
15+
runs-on: "ubuntu-latest"
16+
strategy:
17+
matrix:
18+
php-version:
19+
- "8.1"
20+
21+
steps:
22+
- uses: "actions/checkout@v3"
23+
- uses: "shivammathur/setup-php@v2"
24+
with:
25+
coverage: "none"
26+
php-version: "${{ matrix.php-version }}"
27+
ini-values: "${{ env.INI_VALUES }}"
28+
tools: composer-normalize,composer-require-checker,composer-unused
29+
- uses: "ramsey/composer-install@v2"
30+
31+
- run: "composer validate --strict"
32+
- run: "composer-normalize --dry-run"
33+
- run: "composer-require-checker check --config-file=$(realpath composer-require-checker.json)"
34+
- run: "composer-unused"
35+
36+
tests:
37+
name: "Tests"
38+
runs-on: "ubuntu-latest"
39+
strategy:
40+
matrix:
41+
php-version:
42+
- "8.2"
43+
code-coverage:
44+
- "none"
45+
include:
46+
- php-version: "8.1"
47+
code-coverage: "pcov"
48+
49+
steps:
50+
- uses: "actions/checkout@v3"
51+
- uses: "shivammathur/setup-php@v2"
52+
with:
53+
coverage: "${{ matrix.code-coverage }}"
54+
php-version: "${{ matrix.php-version }}"
55+
ini-values: "${{ env.INI_VALUES }}"
56+
- uses: "ramsey/composer-install@v2"
57+
58+
- run: "vendor/bin/phpunit --no-coverage --no-logging"
59+
if: ${{ matrix.code-coverage == 'none' }}
60+
timeout-minutes: 1
61+
62+
- run: "vendor/bin/phpunit"
63+
if: ${{ matrix.code-coverage != 'none' }}
64+
timeout-minutes: 1
65+
66+
coding-standards:
67+
name: "Coding Standards"
68+
runs-on: "ubuntu-latest"
69+
strategy:
70+
matrix:
71+
php-version:
72+
- "8.1"
73+
74+
steps:
75+
- uses: "actions/checkout@v3"
76+
- uses: "shivammathur/setup-php@v2"
77+
with:
78+
coverage: "none"
79+
php-version: "${{ matrix.php-version }}"
80+
ini-values: "${{ env.INI_VALUES }}"
81+
- uses: "ramsey/composer-install@v2"
82+
83+
- run: "vendor/bin/php-cs-fixer fix --verbose --dry-run --diff"
84+
85+
static-analysis:
86+
name: "Static Analysis"
87+
runs-on: "ubuntu-latest"
88+
strategy:
89+
matrix:
90+
php-version:
91+
- "8.1"
92+
93+
steps:
94+
- uses: "actions/checkout@v3"
95+
- uses: "shivammathur/setup-php@v2"
96+
with:
97+
coverage: "none"
98+
php-version: "${{ matrix.php-version }}"
99+
ini-values: "${{ env.INI_VALUES }}"
100+
- uses: "ramsey/composer-install@v2"
101+
102+
- run: "vendor/bin/phpstan analyse --no-progress --error-format=github"

.github/workflows/integrate.yaml

Lines changed: 0 additions & 181 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/.idea/
2-
/coverage/
2+
/.phpunit.cache/
33
/vendor/
4+
/coverage/
45
/.php-cs-fixer.cache
56
/.phpunit.result.cache
67
/composer.lock

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1+
CSFIX_PHP_BIN=PHP_CS_FIXER_IGNORE_ENV=1 php8.2
2+
PHP_BIN=php8.2 -d zend.assertions=1
3+
COMPOSER_BIN=$(shell command -v composer)
4+
15
all: csfix static-analysis test
26
@echo "Done."
37

48
vendor: composer.json
5-
composer update
6-
composer bump
9+
$(PHP_BIN) $(COMPOSER_BIN) update
10+
$(PHP_BIN) $(COMPOSER_BIN) bump
711
touch vendor
812

913
.PHONY: csfix
1014
csfix: vendor
11-
vendor/bin/php-cs-fixer fix --verbose
15+
$(CSFIX_PHP_BIN) vendor/bin/php-cs-fixer fix -v $(arg)
1216

1317
.PHONY: static-analysis
1418
static-analysis: vendor
15-
php -d zend.assertions=1 vendor/bin/phpstan analyse
19+
$(PHP_BIN) vendor/bin/phpstan analyse $(PHPSTAN_ARGS)
1620

1721
.PHONY: test
1822
test: vendor
19-
php -d zend.assertions=1 vendor/bin/phpunit
23+
$(PHP_BIN) vendor/bin/phpunit $(PHPUNIT_ARGS)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# php-errorhandler-legacy
22

33
[![Latest Stable Version](https://img.shields.io/packagist/v/slam/php-errorhandler-legacy.svg)](https://packagist.org/packages/slam/php-errorhandler-legacy)
4-
[![Integrate](https://github.com/Slamdunk/php-errorhandler-legacy/workflows/Integrate/badge.svg?branch=master)](https://github.com/Slamdunk/php-errorhandler-legacy/actions)
4+
[![Downloads](https://img.shields.io/packagist/dt/slam/php-errorhandler-legacy.svg)](https://packagist.org/packages/slam/php-errorhandler-legacy)
5+
[![Integrate](https://github.com/Slamdunk/php-errorhandler-legacy/workflows/CI/badge.svg)](https://github.com/Slamdunk/php-errorhandler-legacy/actions)
56

67
Crappy class to manage errors and exceptions

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"php": "~8.1.0 || ~8.2.0"
1515
},
1616
"require-dev": {
17-
"phpstan/phpstan": "^1.9.6",
18-
"phpstan/phpstan-phpunit": "^1.3.3",
19-
"phpstan/phpstan-strict-rules": "^1.4.4",
20-
"phpunit/phpunit": "^9.5.27",
17+
"phpstan/phpstan": "^1.9.17",
18+
"phpstan/phpstan-phpunit": "^1.3.4",
19+
"phpstan/phpstan-strict-rules": "^1.4.5",
20+
"phpunit/phpunit": "^10.0.7",
2121
"slam/php-cs-fixer-extensions": "^3.3",
2222
"slam/php-debug-r": "^1.7.0",
23-
"symfony/console": "^6.2.3"
23+
"symfony/console": "^6.2.5"
2424
},
2525
"autoload": {
2626
"psr-4": {

phpunit.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0"?>
2-
<phpunit
2+
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
55
colors="true"
6-
verbose="true"
6+
cacheDirectory=".phpunit.cache"
77
>
88
<coverage>
99
<include>
1010
<directory suffix=".php">./lib</directory>
1111
</include>
1212
<report>
13-
<clover outputFile="coverage/clover.xml" />
14-
<html outputDirectory="coverage/html" />
13+
<clover outputFile="coverage/clover.xml"/>
14+
<html outputDirectory="coverage/html"/>
1515
<text outputFile="php://stdout" showOnlySummary="true"/>
1616
</report>
1717
</coverage>

0 commit comments

Comments
 (0)