Skip to content

Commit e06cf84

Browse files
committed
Update PHPUnit configuration schema for PHPUnit 9.3
1 parent dada123 commit e06cf84

File tree

4 files changed

+37
-14
lines changed

4 files changed

+37
-14
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
/.travis.yml export-ignore
44
/examples export-ignore
55
/phpunit.xml.dist export-ignore
6+
/phpunit.xml.legacy export-ignore
67
/tests export-ignore

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ install:
2323
- composer install
2424

2525
script:
26-
- vendor/bin/phpunit --coverage-text
26+
- if [[ "$TRAVIS_PHP_VERSION" > "7.2" ]]; then vendor/bin/phpunit --coverage-text; fi
27+
- if [[ "$TRAVIS_PHP_VERSION" < "7.3" ]]; then vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy; fi

phpunit.xml.dist

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
3+
<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
116
bootstrap="vendor/autoload.php"
12-
>
7+
colors="true"
8+
cacheResult="false">
139
<testsuites>
1410
<testsuite name="Datagram Test Suite">
1511
<directory>./tests/</directory>
1612
</testsuite>
1713
</testsuites>
18-
<filter>
19-
<whitelist>
14+
<coverage>
15+
<include>
2016
<directory>./src/</directory>
21-
</whitelist>
22-
</filter>
17+
</include>
18+
</coverage>
2319
</phpunit>

phpunit.xml.legacy

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
6+
backupGlobals="false"
7+
backupStaticAttributes="false"
8+
bootstrap="vendor/autoload.php"
9+
colors="true"
10+
convertErrorsToExceptions="true"
11+
convertNoticesToExceptions="true"
12+
convertWarningsToExceptions="true"
13+
processIsolation="false"
14+
stopOnFailure="false">
15+
<testsuites>
16+
<testsuite name="Datagram Test Suite">
17+
<directory>./tests/</directory>
18+
</testsuite>
19+
</testsuites>
20+
<filter>
21+
<whitelist>
22+
<directory>./src/</directory>
23+
</whitelist>
24+
</filter>
25+
</phpunit>

0 commit comments

Comments
 (0)