Skip to content

Commit 1faee5b

Browse files
authored
Merge pull request #198 from GrahamCampbell/patch-1
PHP 8.0 support
2 parents 75470e5 + 2895bd8 commit 1faee5b

File tree

4 files changed

+124
-50
lines changed

4 files changed

+124
-50
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
/.php_cs export-ignore
66
/.scrutinizer.yml export-ignore
77
/.styleci.yml export-ignore
8-
/.travis.yml export-ignore
98
/behat.yml.dist export-ignore
109
/features/ export-ignore
1110
/phpspec.ci.yml export-ignore

.github/workflows/tests.yml

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
latest:
9+
name: PHP ${{ matrix.php }} Latest
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ matrix.php }}
23+
tools: composer:v2
24+
coverage: none
25+
26+
- name: Install PHP 7 dependencies
27+
run: composer update --prefer-dist --no-interaction --no-progress
28+
if: "matrix.php != '8.0'"
29+
30+
- name: Install PHP 8 dependencies
31+
run: |
32+
composer require "phpunit/phpunit:^9.3@dev" "phpunit/php-code-coverage:^9.0@dev" "sebastian/global-state:^5.0@dev" "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update
33+
composer update --prefer-dist --no-interaction --no-progress --ignore-platform-req=php
34+
if: "matrix.php == '8.0'"
35+
36+
- name: Execute tests
37+
run: composer test
38+
39+
lowest:
40+
name: PHP ${{ matrix.php }} Lowest
41+
runs-on: ubuntu-latest
42+
strategy:
43+
matrix:
44+
php: ['7.1', '7.2', '7.3', '7.4']
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v2
49+
50+
- name: Setup PHP
51+
uses: shivammathur/setup-php@v2
52+
with:
53+
php-version: ${{ matrix.php }}
54+
tools: composer:v2
55+
coverage: none
56+
57+
- name: Install dependencies
58+
run: |
59+
composer require "sebastian/comparator:^3.0.2" --no-interaction --no-update
60+
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress
61+
62+
- name: Execute tests
63+
run: composer test
64+
65+
symfony:
66+
name: Symfony ${{ matrix.symfony }} LTS
67+
runs-on: ubuntu-latest
68+
strategy:
69+
matrix:
70+
symfony: ['2', '3', '4']
71+
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v2
75+
76+
- name: Setup PHP
77+
uses: shivammathur/setup-php@v2
78+
with:
79+
php-version: 7.1
80+
tools: composer:v2
81+
coverage: none
82+
83+
- name: Pin old packages
84+
run: composer require "phpspec/phpspec:^2.5.8" --no-interaction --no-update
85+
if: "matrix.symfony == '2'"
86+
87+
- name: Install dependencies
88+
run: |
89+
composer require dunglas/symfony-lock:v${{ matrix.symfony }} --no-interaction --no-update
90+
composer update --prefer-dist --no-interaction --prefer-stable --prefer-lowest --no-progress
91+
92+
- name: Execute tests
93+
run: composer test
94+
95+
coverage:
96+
name: Code Coverage
97+
runs-on: ubuntu-latest
98+
99+
steps:
100+
- name: Checkout code
101+
uses: actions/checkout@v2
102+
103+
- name: Setup PHP
104+
uses: shivammathur/setup-php@v2
105+
with:
106+
php-version: 7.4
107+
tools: composer:v2
108+
coverage: xdebug
109+
110+
- name: Install dependencies
111+
run: |
112+
composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update
113+
composer update --prefer-dist --no-interaction --no-progress
114+
115+
- name: Execute tests
116+
run: composer test-ci
117+
118+
- name: Upload coverage
119+
run: |
120+
wget https://scrutinizer-ci.com/ocular.phar
121+
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml

.travis.yml

-45
This file was deleted.

composer.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.1",
14+
"php": "^7.1 || ^8.0",
1515
"php-http/httplug": "^2.0",
1616
"php-http/message-factory": "^1.0",
1717
"php-http/message": "^1.6",
@@ -26,9 +26,8 @@
2626
"guzzlehttp/psr7": "^1.4",
2727
"nyholm/psr7": "^1.2",
2828
"phpspec/phpspec": "^5.1 || ^6.0",
29-
"phpspec/prophecy": "^1.8",
30-
"phpunit/phpunit": "^7.5",
31-
"sebastian/comparator": "^3.0"
29+
"phpspec/prophecy": "^1.10.2",
30+
"phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3"
3231
},
3332
"suggest": {
3433
"ext-json": "To detect JSON responses with the ContentTypePlugin",

0 commit comments

Comments
 (0)