Skip to content

Commit 3087216

Browse files
greg0iremwadon
authored andcommitted
Phpunit8 compat (#60)
* Add compatibility with PHPUnit 8 * Ignore phpunit result cache * Add missing newline at EOF * Reduce differences with generated config file
1 parent 8e46546 commit 3087216

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.phpunit.result.cache
12
composer.lock
23
phpunit.xml
3-
vendor
4+
vendor

PhpUnit/AbstractConfigurationConstraint.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ abstract class AbstractConfigurationConstraint extends Constraint
1313

1414
public function __construct(ConfigurationInterface $configuration, $breadcrumbPath = null)
1515
{
16-
parent::__construct();
16+
if (is_callable([Constraint::class, '__construct'])) {
17+
parent::__construct();
18+
}
1719

1820
$this->configuration = $configuration;
1921
$this->breadcrumbPath = $breadcrumbPath;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function processed_configuration_for_array_node_1()
254254

255255
| Version | Released | PHPUnit | Status |
256256
|---------|--------------| ------------|------------|
257-
| 4.x | Mar 5, 2018 | 7.x   | Latest |
257+
| 4.x | Mar 5, 2018 | 7.x and 8.x | Latest |
258258
| 3.x | Nov 30, 2017 | 6.x   | Bugfixes |
259259
| 2.x | Jun 18, 2016 | 4.x and 5.x | EOL |
260260
| 1.x | Oct 12, 2014 | 3.x | EOL

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"symfony/config": "^2.7 || ^3.4 || ^4.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^7.0"
20+
"phpunit/phpunit": "^7.0 || ^8.0"
2121
},
2222
"conflict": {
2323
"phpunit/phpunit": "<7.0"

phpunit.xml.dist

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit colors="true" bootstrap="vendor/autoload.php">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.0/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
beStrictAboutOutputDuringTests="true"
6+
beStrictAboutTodoAnnotatedTests="true"
7+
colors="true"
8+
verbose="true">
49
<testsuites>
510
<testsuite name="MatthiasSymfonyConfigTest">
6-
<directory>./Tests</directory>
11+
<directory suffix="Test.php">Tests</directory>
712
</testsuite>
813
</testsuites>
914

1015
<filter>
11-
<whitelist>
12-
<directory>.</directory>
16+
<whitelist processUncoveredFilesFromWhitelist="true">
17+
<directory suffix=".php">.</directory>
1318
<exclude>
1419
<directory>./Tests</directory>
1520
<directory>./vendor</directory>

0 commit comments

Comments
 (0)