Skip to content

Commit 079b7ef

Browse files
committed
Update PHPUnit configuration schema for PHPUnit 9.3
1 parent b6e2fc4 commit 079b7ef

File tree

4 files changed

+51
-14
lines changed

4 files changed

+51
-14
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ jobs:
2828
- run: composer install
2929
- run: docker run -d --name mysql --net=host -e MYSQL_RANDOM_ROOT_PASSWORD=yes -e MYSQL_DATABASE=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test mysql:5
3030
- run: bash tests/wait-for-mysql.sh
31-
- run: MYSQL_USER=test MYSQL_PASSWORD=test vendor/bin/phpunit
31+
- run: MYSQL_USER=test MYSQL_PASSWORD=test vendor/bin/phpunit --coverage-text
32+
if: ${{ matrix.php >= 7.3 }}
33+
- run: MYSQL_USER=test MYSQL_PASSWORD=test vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
34+
if: ${{ matrix.php < 7.3 }}
3235

3336
PHPUnit-hhvm:
3437
name: PHPUnit (HHVM)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"require-dev": {
1616
"clue/block-react": "^1.2",
17-
"phpunit/phpunit": "^9.3 || ^6.0 || ^5.0 || ^4.8.35"
17+
"phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35"
1818
},
1919
"autoload": {
2020
"psr-4": {

phpunit.xml.dist

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit backupGlobals="false"
3+
<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
backupGlobals="false"
46
backupStaticAttributes="false"
5-
colors="true"
7+
bootstrap="vendor/autoload.php"
8+
cacheResult="false"
69
convertErrorsToExceptions="true"
710
convertNoticesToExceptions="true"
811
convertWarningsToExceptions="true"
12+
colors="true"
913
processIsolation="false"
1014
stopOnFailure="false"
11-
bootstrap="vendor/autoload.php"
12-
>
15+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
1316
<testsuites>
1417
<testsuite name="React.MySQL Test Suite">
1518
<directory>./tests/</directory>
1619
</testsuite>
1720
</testsuites>
18-
19-
<filter>
20-
<whitelist>
21+
<coverage>
22+
<include>
2123
<directory>./src/</directory>
22-
</whitelist>
23-
</filter>
24+
</include>
25+
</coverage>
2426
<php>
2527
<env name="DB_HOST" value="127.0.0.1"/>
2628
<env name="DB_PORT" value="3306"/>
27-
<env name="DB_USER" value="test" />
28-
<env name="DB_PASSWD" value="test" />
29-
<env name="DB_DBNAME" value="test" />
29+
<env name="DB_USER" value="test"/>
30+
<env name="DB_PASSWD" value="test"/>
31+
<env name="DB_DBNAME" value="test"/>
3032
</php>
3133
</phpunit>

phpunit.xml.legacy

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
backupGlobals="false"
6+
backupStaticAttributes="false"
7+
bootstrap="vendor/autoload.php"
8+
colors="true"
9+
convertErrorsToExceptions="true"
10+
convertNoticesToExceptions="true"
11+
convertWarningsToExceptions="true"
12+
processIsolation="false"
13+
stopOnFailure="false"
14+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd">
15+
<testsuites>
16+
<testsuite name="React.MySQL Test Suite">
17+
<directory>./tests/</directory>
18+
</testsuite>
19+
</testsuites>
20+
<filter>
21+
<whitelist>
22+
<directory>./src/</directory>
23+
</whitelist>
24+
</filter>
25+
<php>
26+
<env name="DB_HOST" value="127.0.0.1"/>
27+
<env name="DB_PORT" value="3306"/>
28+
<env name="DB_USER" value="test"/>
29+
<env name="DB_PASSWD" value="test"/>
30+
<env name="DB_DBNAME" value="test"/>
31+
</php>
32+
</phpunit>

0 commit comments

Comments
 (0)