Skip to content

Commit

Permalink
Split phpunit configs by version, #61
Browse files Browse the repository at this point in the history
  • Loading branch information
hollodotme committed Aug 12, 2020
1 parent 57287c4 commit 01f1363
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: >
docker-compose exec -T php71 php ${PHP_OPTIONS}
/repo/vendor/bin/phpunit7.phar
-c /repo/build
-c /repo/build/phpunit7.xml
--coverage-clover=/repo/coverage.xml
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
Expand All @@ -71,7 +71,7 @@ jobs:
run: >
docker-compose exec -T php72 php ${PHP_OPTIONS}
/repo/vendor/bin/phpunit8.phar
-c /repo/build
-c /repo/build/phpunit8.xml
--coverage-clover=/repo/coverage.xml
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
Expand All @@ -89,7 +89,7 @@ jobs:
run: >
docker-compose exec -T php73 php ${PHP_OPTIONS}
/repo/vendor/bin/phpunit9.phar
-c /repo/build
-c /repo/build/phpunit9.xml
--coverage-clover=/repo/coverage.xml
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
Expand All @@ -107,7 +107,7 @@ jobs:
run: >
docker-compose exec -T php74 php ${PHP_OPTIONS}
/repo/vendor/bin/phpunit9.phar
-c /repo/build
-c /repo/build/phpunit9.xml
--coverage-clover=/repo/coverage.xml
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
Expand Down
File renamed without changes.
31 changes: 31 additions & 0 deletions build/phpunit8.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<phpunit
bootstrap="../vendor/autoload.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
colors="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true">
<php>
<env name="network-socket-host" value="127.0.0.1"/>
<env name="network-socket-port" value="9001"/>
<env name="unix-domain-socket" value="/var/run/php-uds.sock"/>
<env name="restricted-unix-domain-socket" value="/var/run/php-ruds.sock"/>
<env name="non-existing-unix-domain-socket" value="/tmp/not/existing.sock"/>
<env name="invalid-unix-domain-socket" value="/Fixtures/test.sock"/>
</php>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">../tests/Unit</directory>
</testsuite>
<testsuite name="Integration">
<directory suffix="Test.php">../tests/Integration</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../src</directory>
</whitelist>
</filter>
</phpunit>
29 changes: 29 additions & 0 deletions build/phpunit9.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="../vendor/autoload.php"
verbose="true"
beStrictAboutOutputDuringTests="true"
colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">../src</directory>
</include>
</coverage>
<php>
<env name="network-socket-host" value="127.0.0.1"/>
<env name="network-socket-port" value="9001"/>
<env name="unix-domain-socket" value="/var/run/php-uds.sock"/>
<env name="restricted-unix-domain-socket" value="/var/run/php-ruds.sock"/>
<env name="non-existing-unix-domain-socket" value="/tmp/not/existing.sock"/>
<env name="invalid-unix-domain-socket" value="/Fixtures/test.sock"/>
</php>
<testsuites>
<testsuite name="Unit">
<directory>../tests/Unit</directory>
</testsuite>
<testsuite name="Integration">
<directory>../tests/Integration</directory>
</testsuite>
</testsuites>
</phpunit>
8 changes: 4 additions & 4 deletions tests/runTestsOnAllLocalPhpVersions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ echo -e "\n\033[43mRun PHPUnit\033[0m\n"
echo -e "\n\033[33mOn PHP 7.1\033[0m\n"
docker-compose down
docker-compose up -d --force-recreate php71
docker-compose exec php71 php ${PHP_OPTIONS} vendor/bin/phpunit7.phar -c build
docker-compose exec php71 php ${PHP_OPTIONS} vendor/bin/phpunit7.phar -c build/phpunit7.xml
echo -e "\n\033[33mOn PHP 7.2\033[0m\n"
docker-compose down
docker-compose up -d --force-recreate php72
docker-compose exec php72 php ${PHP_OPTIONS} vendor/bin/phpunit8.phar -c build
docker-compose exec php72 php ${PHP_OPTIONS} vendor/bin/phpunit8.phar -c build/phpunit8.xml
echo -e "\n\033[33mOn PHP 7.3\033[0m\n"
docker-compose down
docker-compose up -d --force-recreate php73
docker-compose exec php73 php ${PHP_OPTIONS} vendor/bin/phpunit9.phar -c build
docker-compose exec php73 php ${PHP_OPTIONS} vendor/bin/phpunit9.phar -c build/phpunit9.xml
echo -e "\n\033[33mOn PHP 7.4\033[0m\n"
docker-compose down
docker-compose up -d --force-recreate php74
docker-compose exec php74 php ${PHP_OPTIONS} vendor/bin/phpunit9.phar -c build
docker-compose exec php74 php ${PHP_OPTIONS} vendor/bin/phpunit9.phar -c build/phpunit9.xml

echo -e "\n\033[43mRun phpstan\033[0m\n"
docker-compose run --rm phpstan

0 comments on commit 01f1363

Please sign in to comment.