Skip to content

Commit

Permalink
Patch phpunit to allow testing in PHP 8.1 (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop authored Sep 17, 2021
1 parent 1d7cce2 commit ab7cca1
Show file tree
Hide file tree
Showing 14 changed files with 322 additions and 524 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-unit-cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
path: |
vendor
key: vendor-${{ hashFiles('composer.lock') }}
key: deps-${{ hashFiles('composer.lock') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -32,7 +32,7 @@ jobs:
tools: composer

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

- name: Run Tests With Coverage
run: make deps test-coverage && bash <(curl -s https://codecov.io/bash)
6 changes: 3 additions & 3 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
operating-system: [ 'ubuntu-latest' ]
php-versions: [ '5.6', '7.0', '7.1', '7.2', '7.3', '8.0' ]
php-versions: [ '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '8.0', '8.1' ]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -21,7 +21,7 @@ jobs:
with:
path: |
vendor
key: vendor-${{ hashFiles('composer.lock') }}
key: deps-${{ hashFiles('composer.lock') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -31,7 +31,7 @@ jobs:
tools: composer

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

- name: Run Tests
run: make deps test
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.12.38] - 2021-09-17

### Fixed
- PHP 8.1 Deprecation notices with missing returns.

## [0.12.37] - 2021-08-29

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

[0.12.38]: https://github.com/swaggest/php-json-schema/compare/v0.12.37...v0.12.38
[0.12.37]: https://github.com/swaggest/php-json-schema/compare/v0.12.36...v0.12.37
[0.12.36]: https://github.com/swaggest/php-json-schema/compare/v0.12.35...v0.12.36
[0.12.35]: https://github.com/swaggest/php-json-schema/compare/v0.12.34...v0.12.35
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ docker-lint:
@docker run -v $$PWD:/app --rm phpstan/phpstan analyze -l 7 -c phpstan.neon ./src

test:
@php -derror_reporting="E_ALL & ~E_DEPRECATED" vendor/bin/phpunit --configuration phpunit.xml
@php vendor/bin/phpunit --configuration phpunit.xml

docker-test-new:
@docker run -v $$PWD:/app -w /app --rm php:8.1.0RC1-zts-buster php vendor/bin/phpunit --configuration phpunit.xml

docker-test-old:
@docker run -v $$PWD:/app -w /app --rm php:5.4-cli php vendor/bin/phpunit --configuration phpunit.xml

test-coverage:
@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
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
"ext-json": "*",
"ext-mbstring": "*",
"phplang/scope-exit": "^1.0",
"swaggest/json-diff": "^3.5.1"
"swaggest/json-diff": "^3.8.2"
},
"require-dev": {
"phpunit/phpunit": "^5",
"phpunit/php-code-coverage": "^4"
"phpunit/phpunit": "^4.8.23"
},
"license": "MIT",
"authors": [
Expand All @@ -36,7 +35,7 @@
},
"config": {
"platform": {
"php": "5.6.0"
"php": "5.4.45"
}
}
}
Loading

0 comments on commit ab7cca1

Please # to comment.