Skip to content

Commit e2ea458

Browse files
authoredJul 14, 2020
Support PHP 7.4 and 8.0 (#52)
1 parent 9947c7f commit e2ea458

File tree

7 files changed

+95
-55
lines changed

7 files changed

+95
-55
lines changed
 

‎.gitattributes

-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
/.php_cs export-ignore
66
/.scrutinizer.yml export-ignore
77
/.styleci.yml export-ignore
8-
/.travis.yml export-ignore
9-
/behat.yml.dist export-ignore
10-
/features/ export-ignore
118
/phpspec.ci.yml export-ignore
129
/phpspec.yml.dist export-ignore
13-
/phpunit.xml.dist export-ignore
1410
/spec/ export-ignore
15-
/tests/ export-ignore

‎.github/workflows/tests.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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 "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update
33+
composer update --prefer-dist --prefer-stable --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+
coverage:
66+
name: Code Coverage
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v2
72+
73+
- name: Setup PHP
74+
uses: shivammathur/setup-php@v2
75+
with:
76+
php-version: 7.4
77+
tools: composer:v2
78+
coverage: xdebug
79+
80+
- name: Install dependencies
81+
run: |
82+
composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update
83+
composer update --prefer-dist --no-interaction --no-progress
84+
85+
- name: Execute tests
86+
run: composer test-ci
87+
88+
- name: Upload coverage
89+
run: |
90+
wget https://scrutinizer-ci.com/ocular.phar
91+
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml

‎.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/behat.yml
21
/build/
32
/composer.lock
43
/phpspec.yml
5-
/phpunit.xml
64
/vendor/

‎.travis.yml

-41
This file was deleted.

‎composer.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.1",
19+
"php": "^7.1 || ^8.0",
2020
"php-http/client-common": "^1.9 || ^2.0",
2121
"php-http/discovery": "^1.0",
2222
"php-http/httplug": "^1.0 || ^2.0",
@@ -31,8 +31,7 @@
3131
"php-http/client-implementation": "1.0"
3232
},
3333
"require-dev": {
34-
"henrikbjorn/phpspec-code-coverage": "^1.0",
35-
"phpspec/phpspec": "^2.4"
34+
"phpspec/phpspec": "^5.1 || ^6.0"
3635
},
3736
"config": {
3837
"sort-packages": true
@@ -47,8 +46,6 @@
4746
"Http\\Mock\\": "src/"
4847
}
4948
},
50-
"minimum-stability": "dev",
51-
"prefer-stable": true,
5249
"scripts": {
5350
"test": "vendor/bin/phpspec run",
5451
"test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml"

‎phpspec.ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ suites:
44
psr4_prefix: Http\Mock
55
formatter.name: pretty
66
extensions:
7-
- PhpSpec\Extension\CodeCoverageExtension
7+
FriendsOfPhpSpec\PhpSpec\CodeCoverage\CodeCoverageExtension: ~
88
code_coverage:
99
format: clover
1010
output: build/coverage.xml

‎spec/ClientSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Http\Message\RequestMatcher;
88
use Http\Message\ResponseFactory;
99
use Http\Mock\Client;
10-
use Psr\Http\Client\ClientExceptionInterface;
10+
use Http\Client\Exception as ClientExceptionInterface;
1111
use Psr\Http\Message\RequestInterface;
1212
use Psr\Http\Message\ResponseInterface;
1313
use PhpSpec\ObjectBehavior;

0 commit comments

Comments
 (0)
Please sign in to comment.