Skip to content

Commit ef9492e

Browse files
authored
Changes to meta files and support for PHPUnit 9 (#161)
* Only support PHPUnit 8.5 and 9.4 * Updated meta files * Make sure we support PHP 7.1 * MIgrate config * Cleanup .travis.yml and cure my OCD =)
1 parent d0cddd6 commit ef9492e

File tree

5 files changed

+48
-58
lines changed

5 files changed

+48
-58
lines changed

.gitattributes

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
.github/ export-ignore
2-
tests/ export-ignore
3-
.editorconfig export-ignore
4-
.gitattributes export-ignore
5-
.gitignore export-ignore
6-
.php_cs export-ignore
7-
.scrutinizer.yml export-ignore
8-
.travis.yml export-ignore
9-
phpstan.neon.dist export-ignore
10-
phpunit.xml.dist export-ignore
1+
.github/ export-ignore
2+
tests/ export-ignore
3+
.editorconfig export-ignore
4+
.gitattributes export-ignore
5+
.gitignore export-ignore
6+
.php_cs export-ignore
7+
.scrutinizer.yml export-ignore
8+
.travis.yml export-ignore
9+
phpstan.neon.dist export-ignore
10+
phpstan.baseline.dist export-ignore
11+
phpunit.xml.dist export-ignore

.gitignore

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/composer.lock
2-
/phpstan.neon
3-
/phpunit.xml
4-
/vendor/
1+
composer.lock
2+
phpstan.neon
3+
phpunit.xml
4+
vendor
5+
.php_cs.cache
6+
.phpunit.result.cache

.travis.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,21 @@ php:
1313

1414
env:
1515
global:
16-
- TEST_COMMAND="composer test"
16+
- TEST_COMMAND="./vendor/bin/phpunit"
1717

1818
branches:
1919
except:
2020
- /^patch-.*$/
2121

2222
matrix:
2323
fast_finish: true
24-
allow_failures:
25-
- php: nightly
26-
env: COMPOSER_FLAGS="--ignore-platform-reqs"
2724
include:
28-
- php: 7.2
29-
name: Lowest version of dependencies
30-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
31-
- php: nightly
32-
name: PHP 8.0
33-
env: COMPOSER_FLAGS="--ignore-platform-reqs"
34-
35-
before_install:
36-
- if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
25+
- name: "PHP: 8.0"
26+
php: nightly
27+
28+
- name: "Lowest version of dependencies"
29+
php: 7.2
30+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="./vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
3731

3832
install:
3933
- composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction

composer.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "A fast PHP7 implementation of PSR-7",
44
"license": "MIT",
55
"keywords": ["psr-7", "psr-17"],
6-
"homepage": "http://tnyholm.se",
6+
"homepage": "https://tnyholm.se",
77
"authors": [
88
{
99
"name": "Tobias Nyholm",
@@ -21,7 +21,7 @@
2121
"psr/http-factory": "^1.0"
2222
},
2323
"require-dev": {
24-
"phpunit/phpunit": "^7.5 || 8.5",
24+
"phpunit/phpunit": "^7.5 || 8.5 || 9.4",
2525
"php-http/psr7-integration-tests": "^1.0",
2626
"http-interop/http-factory-tests": "^0.8",
2727
"symfony/error-handler": "^4.4"
@@ -40,10 +40,6 @@
4040
"Tests\\Nyholm\\Psr7\\": "tests/"
4141
}
4242
},
43-
"scripts": {
44-
"test": "vendor/bin/phpunit",
45-
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
46-
},
4743
"extra": {
4844
"branch-alias": {
4945
"dev-master": "1.0-dev"

phpunit.xml.dist

+22-25
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit colors="true" bootstrap="vendor/autoload.php">
3-
<testsuites>
4-
<testsuite name="Unit tests">
5-
<directory>tests/</directory>
6-
</testsuite>
7-
8-
<testsuite name="Integration tests">
9-
<directory>./vendor/http-interop/http-factory-tests/test</directory>
10-
</testsuite>
11-
</testsuites>
12-
13-
<filter>
14-
<whitelist>
15-
<directory suffix=".php">src/</directory>
16-
</whitelist>
17-
</filter>
18-
19-
<php>
20-
<const name="REQUEST_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
21-
<const name="RESPONSE_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
22-
<const name="SERVER_REQUEST_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
23-
<const name="UPLOADED_FILE_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
24-
<const name="URI_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
25-
<const name="STREAM_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
26-
</php>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="Unit tests">
10+
<directory>tests/</directory>
11+
</testsuite>
12+
<testsuite name="Integration tests">
13+
<directory>./vendor/http-interop/http-factory-tests/test</directory>
14+
</testsuite>
15+
</testsuites>
16+
<php>
17+
<const name="REQUEST_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
18+
<const name="RESPONSE_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
19+
<const name="SERVER_REQUEST_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
20+
<const name="UPLOADED_FILE_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
21+
<const name="URI_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
22+
<const name="STREAM_FACTORY" value="Nyholm\Psr7\Factory\Psr17Factory"/>
23+
</php>
2724
</phpunit>

0 commit comments

Comments
 (0)