Skip to content

Commit

Permalink
Merge pull request #177 from SimonFrings/tests
Browse files Browse the repository at this point in the history
Update PHPUnit configuration schema for PHPUnit 9.3 and minor clean up
  • Loading branch information
jsor authored Aug 19, 2020
2 parents d3d4ec3 + 8528277 commit ee56552
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/phpunit.xml.legacy export-ignore
/tests export-ignore
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
composer.lock
composer.phar
phpunit.xml
build/
vendor/
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ install:
- composer install

script:
- ./vendor/bin/phpunit -v --coverage-text --coverage-clover=./build/logs/clover.xml
- if [[ "$TRAVIS_PHP_VERSION" > "7.2" ]]; then vendor/bin/phpunit --coverage-text --coverage-clover=./build/logs/clover.xml; fi
- if [[ "$TRAVIS_PHP_VERSION" < "7.3" ]]; then vendor/bin/phpunit --coverage-text --coverage-clover=./build/logs/clover.xml -c phpunit.xml.legacy; fi

after_script:
- if [ -f ./build/logs/clover.xml ]; then travis_retry composer require php-coveralls/php-coveralls --no-interaction --update-with-dependencies; fi
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"php": ">=7.1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0 || ^7.5"
"phpunit/phpunit": "^9.3 || ^7.5"
},
"autoload": {
"psr-4": {
Expand Down
22 changes: 13 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="vendor/autoload.php" colors="true">
<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
cacheResult="false">
<testsuites>
<testsuite name="Promise Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>./src/</directory>
<exclude>
<file>./src/functions_include.php</file>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<file>./src/functions_include.php</file>
</exclude>
</coverage>
</phpunit>
21 changes: 21 additions & 0 deletions phpunit.xml.legacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Promise Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./src/</directory>
<exclude>
<file>./src/functions_include.php</file>
</exclude>
</whitelist>
</filter>
</phpunit>
1 change: 0 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace React\Promise;

use PHPUnit\Framework\TestCase as BaseTestCase;
use React\Promise\Stub\CallableStub;

class TestCase extends BaseTestCase
{
Expand Down

0 comments on commit ee56552

Please sign in to comment.