Skip to content

Commit a87528d

Browse files
authored
PHPUnit 10 (#21)
1 parent d219499 commit a87528d

17 files changed

+175
-252
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "weekly"
8-
commit-message:
9-
include: "scope"
10-
prefix: "composer"
11-
labels:
12-
- "dependency-update"
138
versioning-strategy: "widen"
9+
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "weekly"

.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"
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: 3
61+
62+
- run: "vendor/bin/phpunit --no-logging"
63+
if: ${{ matrix.code-coverage != 'none' }}
64+
timeout-minutes: 3
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 & 169 deletions
This file was deleted.

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
.idea/
2-
vendor/
3-
.php-cs-fixer.cache
4-
composer.lock
5-
.phpunit.result.cache
1+
/.idea/
2+
/.phpunit.cache/
3+
/vendor/
4+
/coverage/
5+
/.php-cs-fixer.cache
6+
/.phpunit.result.cache
7+
/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 -d error_reporting=-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
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

77
[PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) extensions and configurations
88

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"php": "~8.1.0 || ~8.2.0",
1414
"ext-mbstring": "*",
1515
"ext-tokenizer": "*",
16-
"friendsofphp/php-cs-fixer": "^3.13.2"
16+
"friendsofphp/php-cs-fixer": "^3.14.4"
1717
},
1818
"require-dev": {
19-
"phpstan/phpstan": "^1.9.6",
20-
"phpstan/phpstan-phpunit": "^1.3.3",
21-
"phpunit/phpunit": "^9.5.27",
19+
"phpstan/phpstan": "^1.10.1",
20+
"phpstan/phpstan-phpunit": "^1.3.7",
21+
"phpunit/phpunit": "^10.0.11",
2222
"slam/php-debug-r": "^1.7.0",
2323
"slam/phpstan-extensions": "^6.0.0"
2424
},

lib/Config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ final class Config extends PhpCsFixerConfig
5757
'nullable_type_declaration_for_default_null_value' => true,
5858
'ordered_class_elements' => ['order' => ['use_trait', 'constant_public', 'constant_protected', 'constant_private', 'property', 'construct', 'destruct', 'magic', 'phpunit', 'method']],
5959
'ordered_interfaces' => true,
60+
'php_unit_data_provider_static' => true,
6061
'php_unit_internal_class' => false,
6162
'php_unit_size_class' => false,
6263
'php_unit_strict' => false,

phpunit.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
bootstrap="./vendor/autoload.php"
65
colors="true"
7-
verbose="true"
6+
cacheDirectory=".phpunit.cache"
87
>
98
<coverage>
109
<include>

0 commit comments

Comments
 (0)