Make WordPress Core

Changeset 40547


Ignore:
Timestamp:
04/24/2017 12:37:19 AM (7 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Backport various recent changes to the 4.7 branch.

  • Add support for PHPUnit 6+.
  • Add Composer files to the cache on Travis.
  • Remove HHVM from the test infrastructure on Travis.

Merges [40536], [40538], [40539], and [40546] to the 4.7 branch.

See #40539
Fixes #39822, #40548

Location:
branches/4.7
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/.travis.yml

    r40435 r40547  
    55  directories:
    66    - node_modules
     7    - vendor
     8    - $HOME/.composer/cache
    79env:
    810  global:
     
    2224  - php: 5.3
    2325  - php: 5.2
    24   - php: hhvm
    25     sudo: required
    26     dist: trusty
    27     group: edge
    28     addons:
    29       apt:
    30         packages:
    31         - mysql-server-5.6
    32         - mysql-client-core-5.6
    33         - mysql-client-5.6
    3426  - php: nightly
    3527  allow_failures:
    36   - php: hhvm
    3728  - php: nightly
    3829before_install:
     
    5344before_script:
    5445- |
    55   # Remove Xdebug for a huge performance increase, but not from nightly or hhvm:
     46  # Remove Xdebug for a huge performance increase, but not from nightly:
    5647  stable='^[0-9\.]+$'
    5748  if [[ "$TRAVIS_PHP_VERSION" =~ $stable ]]; then
     
    6859  if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
    6960    case "$TRAVIS_PHP_VERSION" in
    70       7.1|7.0|hhvm|nightly)
    71         echo "Using PHPUnit 5.7"
    72         composer global require "phpunit/phpunit=5.7.*"
     61      7.1|7.0|nightly)
     62        echo "Using PHPUnit 6.1"
     63        composer global require "phpunit/phpunit=6.1.*"
    7364        ;;
    7465      5.6|5.5|5.4|5.3)
     
    9586- phpenv versions
    9687- php --version
    97 - |
    98   # Debug PHP extensions, but not on HHVM because the command hangs indefinitely:
    99   if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' ]]; then
    100     php -m
    101   fi
     88- php -m
    10289- npm --version
    10390- node --version
  • branches/4.7/tests/phpunit/includes/bootstrap.php

    r40116 r40547  
    44 */
    55
     6/**
     7 * Compatibility with PHPUnit 6+
     8 */
     9if ( class_exists( 'PHPUnit\Runner\Version' ) ) {
     10    require_once dirname( __FILE__ ) . '/phpunit6-compat.php';
     11}
    612
    713$config_file_path = dirname( dirname( __FILE__ ) );
  • branches/4.7/tests/phpunit/includes/testcase-ajax.php

    r38168 r40547  
    201201            $this->_last_response = $buffer;
    202202    }
     203
     204    /**
     205     * PHPUnit 6+ compatibility shim.
     206     *
     207     * @param mixed      $exception
     208     * @param string     $message
     209     * @param int|string $code
     210     */
     211    public function setExpectedException( $exception, $message = '', $code = null ) {
     212        if ( is_callable( 'parent::setExpectedException' ) ) {
     213            parent::setExpectedException( $exception, $message, $code );
     214        } else {
     215            $this->expectException( $exception );
     216            if ( '' !== $message ) {
     217                $this->expectExceptionMessage( $message );
     218            }
     219            if ( null !== $code ) {
     220                $this->expectExceptionCode( $code );
     221            }
     222        }
     223    }
    203224}
Note: See TracChangeset for help on using the changeset viewer.