Skip to content

Commit ab7cca1

Browse files
authored
Patch phpunit to allow testing in PHP 8.1 (#131)
1 parent 1d7cce2 commit ab7cca1

File tree

14 files changed

+322
-524
lines changed

14 files changed

+322
-524
lines changed

.github/workflows/test-unit-cov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
path: |
2323
vendor
24-
key: vendor-${{ hashFiles('composer.lock') }}
24+
key: deps-${{ hashFiles('composer.lock') }}
2525

2626
- name: Setup PHP
2727
uses: shivammathur/setup-php@v2
@@ -32,7 +32,7 @@ jobs:
3232
tools: composer
3333

3434
- name: Populate vendor
35-
run: '[ -e vendor ] || composer install'
35+
run: '[ -e vendor ] || (composer install && patch -s -p0 < ./tests/phpunit.patch)'
3636

3737
- name: Run Tests With Coverage
3838
run: make deps test-coverage && bash <(curl -s https://codecov.io/bash)

.github/workflows/test-unit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
operating-system: [ 'ubuntu-latest' ]
14-
php-versions: [ '5.6', '7.0', '7.1', '7.2', '7.3', '8.0' ]
14+
php-versions: [ '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '8.0', '8.1' ]
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v2
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
path: |
2323
vendor
24-
key: vendor-${{ hashFiles('composer.lock') }}
24+
key: deps-${{ hashFiles('composer.lock') }}
2525

2626
- name: Setup PHP
2727
uses: shivammathur/setup-php@v2
@@ -31,7 +31,7 @@ jobs:
3131
tools: composer
3232

3333
- name: Populate vendor
34-
run: '[ -e vendor ] || composer install'
34+
run: '[ -e vendor ] || (composer install && patch -s -p0 < ./tests/phpunit.patch)'
3535

3636
- name: Run Tests
3737
run: make deps test

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.12.38] - 2021-09-17
8+
9+
### Fixed
10+
- PHP 8.1 Deprecation notices with missing returns.
11+
712
## [0.12.37] - 2021-08-29
813

914
### Added
@@ -101,6 +106,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
101106
### Changed
102107
- Export `null` value instead of skipping it for properties having `null` type.
103108

109+
[0.12.38]: https://github.com/swaggest/php-json-schema/compare/v0.12.37...v0.12.38
104110
[0.12.37]: https://github.com/swaggest/php-json-schema/compare/v0.12.36...v0.12.37
105111
[0.12.36]: https://github.com/swaggest/php-json-schema/compare/v0.12.35...v0.12.36
106112
[0.12.35]: https://github.com/swaggest/php-json-schema/compare/v0.12.34...v0.12.35

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ docker-lint:
1212
@docker run -v $$PWD:/app --rm phpstan/phpstan analyze -l 7 -c phpstan.neon ./src
1313

1414
test:
15-
@php -derror_reporting="E_ALL & ~E_DEPRECATED" vendor/bin/phpunit --configuration phpunit.xml
15+
@php vendor/bin/phpunit --configuration phpunit.xml
16+
17+
docker-test-new:
18+
@docker run -v $$PWD:/app -w /app --rm php:8.1.0RC1-zts-buster php vendor/bin/phpunit --configuration phpunit.xml
19+
20+
docker-test-old:
21+
@docker run -v $$PWD:/app -w /app --rm php:5.4-cli php vendor/bin/phpunit --configuration phpunit.xml
1622

1723
test-coverage:
1824
@php -derror_reporting="E_ALL & ~E_DEPRECATED" -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --configuration phpunit.xml --coverage-text --coverage-clover=coverage.xml

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
"ext-json": "*",
88
"ext-mbstring": "*",
99
"phplang/scope-exit": "^1.0",
10-
"swaggest/json-diff": "^3.5.1"
10+
"swaggest/json-diff": "^3.8.2"
1111
},
1212
"require-dev": {
13-
"phpunit/phpunit": "^5",
14-
"phpunit/php-code-coverage": "^4"
13+
"phpunit/phpunit": "^4.8.23"
1514
},
1615
"license": "MIT",
1716
"authors": [
@@ -36,7 +35,7 @@
3635
},
3736
"config": {
3837
"platform": {
39-
"php": "5.6.0"
38+
"php": "5.4.45"
4039
}
4140
}
4241
}

0 commit comments

Comments
 (0)