Skip to content

Commit 40381d8

Browse files
authored
Merge pull request #300 from clue-labs/phpunit8
Update test environment to fix tests on legacy PHP 7.2 with PHPUnit 8.5
2 parents f439204 + 373ab3e commit 40381d8

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ jobs:
3232
coverage: ${{ matrix.php < 8.0 && 'xdebug' || 'pcov' }}
3333
ini-file: development
3434
- run: composer install
35-
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml
36-
if: ${{ matrix.php >= 7.3 }}
37-
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml -c phpunit.xml.legacy
38-
if: ${{ matrix.php < 7.3 }}
35+
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml ${{ matrix.php < 7.3 && '-c phpunit.xml.legacy' || '' }}
3936
- name: Check 100% code coverage
4037
shell: php {0}
4138
run: |
@@ -108,8 +105,8 @@ jobs:
108105
with:
109106
php-version: 8.5
110107
- run: composer install -d tests/integration/
111-
- run: docker build -f tests/integration/${{ matrix.dockerfile }} tests/integration/
112-
- run: docker run -d -p 8080:8080 -v "$PWD/composer.json":/app/composer.json $(docker images -q | head -n1)
108+
- run: docker build -t fx -f tests/integration/${{ matrix.dockerfile }} tests/integration/
109+
- run: docker run -d -p 8080:8080 -v "$PWD/composer.json":/app/composer.json fx
113110
- run: bash tests/await.bash
114111
- run: bash tests/integration.bash
115112
- run: docker stop $(docker ps -qn1)
@@ -132,8 +129,8 @@ jobs:
132129
with:
133130
php-version: 8.5
134131
- run: composer install -d tests/integration/
135-
- run: docker build -f tests/integration/Dockerfile-basics tests/integration/
136-
- run: docker run -d -p 8080:8080 -v "$PWD/composer.json":/app/composer.json $(docker images -q | head -n1)
132+
- run: docker build -t fx -f tests/integration/Dockerfile-basics tests/integration/
133+
- run: docker run -d -p 8080:8080 -v "$PWD/composer.json":/app/composer.json fx
137134
- run: docker run -d --net=host -v "$PWD/tests/integration/":/home/framework-x/ -v "$PWD"/tests/integration/${{ matrix.config.path }}:/etc/nginx/conf.d/default.conf nginx:stable-alpine
138135
- run: bash tests/await.bash http://localhost/
139136
- run: bash tests/integration.bash http://localhost/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"require-dev": {
2222
"phpstan/phpstan": "1.12.32 || 1.4.10",
23-
"phpunit/phpunit": "^9.6 || ^7.5",
23+
"phpunit/phpunit": "^9.6 || ^8.5 || ^7.5",
2424
"psr/container": "^2 || ^1"
2525
},
2626
"autoload": {

0 commit comments

Comments
 (0)