WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/28/2019 02:10:24 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/functions.php

    r44118 r44701  
    11<?php
     2
     3/**
     4 * Retrieves PHPUnit runner version.
     5 */
     6function tests_get_phpunit_version() {
     7    if ( class_exists( 'PHPUnit_Runner_Version' ) ) {
     8        $version = PHPUnit_Runner_Version::id();
     9    } elseif ( class_exists( 'PHPUnit\Runner\Version' ) ) {
     10        // Must be parsable by PHP 5.2.x.
     11        $version = call_user_func( 'PHPUnit\Runner\Version::id' );
     12    } else {
     13        $version = 0;
     14    }
     15
     16    return $version;
     17}
    218
    319/**
Note: See TracChangeset for help on using the changeset viewer.