Skip to content

Commit a0501aa

Browse files
committed
Switch to using dual PHPUnit configs
Phpunit 9 won't run under 7.2, but phpunit 8 doesn't understand the config for v9. This here is an attempt at a "dual boot" of sorts. The old config is restored to a separate file so we can pass the legacy config for 7.2 but still use the new config format for other versions.
1 parent 41f1f80 commit a0501aa

2 files changed

Lines changed: 49 additions & 5 deletions

File tree

.travis.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ matrix:
44
include:
55
- php: 7.2
66
dist: bionic
7-
env: COMPOSER_OPTS=""
7+
env: PHPUNIT_LEGACY="true"
88
- php: 7.3
99
dist: bionic
10-
env: COMPOSER_OPTS=""
1110
- php: 7.4
1211
dist: bionic
13-
env: COMPOSER_OPTS=""
1412
- php: nightly
1513
dist: bionic
1614
env: COMPOSER_OPTS="--ignore-platform-reqs"
@@ -27,8 +25,18 @@ install:
2725

2826
script:
2927
- vendor/bin/grumphp run
30-
- composer test
31-
- composer infection
28+
29+
- if [[ -z "$PHPUNIT_LEGACY" ]]; then composer test; else
30+
vendor/bin/phpunit --testdox --color=always
31+
--configuration tests/phpunit.legacy.xml
32+
; fi
33+
34+
- if [[ -z "$PHPUNIT_LEGACY" ]]; then composer infection; else
35+
vendor/bin/infection --ansi --threads=4 --coverage=tests/test-results
36+
--test-framework-options="-c tests/phpunit.legacy.xml"
37+
--only-covered --min-msi=100 --min-covered-msi=100
38+
; fi
39+
3240
- composer psalm
3341

3442
after_success: bash <(curl -s https://codecov.io/bash)

tests/phpunit.legacy.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
bootstrap="phpunit-bootstrap.php"
4+
convertErrorsToExceptions="true"
5+
convertNoticesToExceptions="true"
6+
convertWarningsToExceptions="true"
7+
beStrictAboutTestsThatDoNotTestAnything="true"
8+
beStrictAboutCoversAnnotation="true"
9+
beStrictAboutOutputDuringTests="true"
10+
beStrictAboutChangesToGlobalState="true"
11+
enforceTimeLimit="true"
12+
executionOrder="default"
13+
resolveDependencies="true"
14+
timeoutForLargeTests="1"
15+
timeoutForMediumTests="1"
16+
timeoutForSmallTests="1"
17+
colors="true">
18+
<testsuites>
19+
<testsuite name="All">
20+
<directory suffix="Test.php">../tests/</directory>
21+
</testsuite>
22+
</testsuites>
23+
<filter>
24+
<whitelist>
25+
<directory suffix=".php">../src/</directory>
26+
</whitelist>
27+
</filter>
28+
<logging>
29+
<log type="coverage-html" target="test-results/report" lowUpperBound="49" highLowerBound="89"/>
30+
<log type="coverage-clover" target="test-results/coverage.xml"/>
31+
<log type="coverage-text" target="test-results/report.txt" showUncoveredFiles="false"/>
32+
<log type="junit" target="test-results/logfile.xml"/>
33+
<log type="testdox-html" target="test-results/testdox.html"/>
34+
<log type="testdox-text" target="test-results/testdox.txt"/>
35+
</logging>
36+
</phpunit>

0 commit comments

Comments
 (0)