Skip to content

Commit 001c649

Browse files
Build/Test Tools: Add support for PHPUnit 7.x.
* Create an abstract `WP_UnitTestCase_Base` class to share between PHPUnit 7.x and older versions. * Add a speed-trap loader to determine which `SpeedTrapListener` class needs to be loaded for the current PHPUnit version. * Remove unnecessary `PHPUnit\Util\Test` and `PHPUnit_Util_Getopt` inheritances. * Update Travis CI config to use PHPUnit 7.x for PHP 7.1, 7.2, and nightly PHP versions. Props jipmoors, netweb, desrosj, ayeshrajans, soulseekah, SergeyBiryukov. See #43218. git-svn-id: https://develop.svn.wordpress.org/trunk@44701 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 639f66a commit 001c649

13 files changed

Lines changed: 1556 additions & 1108 deletions

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ before_script:
6767
# Install the specified version of PHPUnit depending on the PHP version:
6868
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
6969
case "$TRAVIS_PHP_VERSION" in
70-
7.3|7.2|7.1|7.0|nightly)
70+
7.3|7.2|7.1|nightly)
71+
echo "Using PHPUnit 7.x"
72+
travis_retry composer global require "phpunit/phpunit:^7"
73+
;;
74+
7.0)
7175
echo "Using PHPUnit 6.x"
7276
travis_retry composer global require "phpunit/phpunit:^6"
7377
;;

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<const name="WP_RUN_CORE_TESTS" value="1" />
4141
</php>
4242
<listeners>
43-
<listener class="SpeedTrapListener" file="tests/phpunit/includes/speed-trap-listener.php">
43+
<listener class="SpeedTrapListener" file="tests/phpunit/includes/listener-loader.php">
4444
<arguments>
4545
<array>
4646
<element key="slowThreshold">

0 commit comments

Comments
 (0)