diff --git a/.travis.yml b/.travis.yml index 53c9522..50cb688 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,12 +55,16 @@ before_script: - | case "$TRAVIS_PHP_VERSION" in 5.6|5.5|5.4|5.3) - composer global require "phpunit/phpunit:^4" + composer global require consolidation/cgr + PATH="$(composer config -g home)/vendor/bin:$PATH" + cgr "phpunit/phpunit:^4" ;; 5.2) ;; *) - composer global require "phpunit/phpunit:6" + composer global require consolidation/cgr + PATH="$(composer config -g home)/vendor/bin:$PATH" + cgr "phpunit/phpunit:^6" ;; esac - | diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index be0ae45..bffe80c 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -31,7 +31,7 @@ function _manually_load_plugin() { } // Core started including their own phpunit6-compat, so we should use that if we can. -if ( ! file_exists( $test_root . '/includes/phpunit6-compat.php' ) ) { +if ( ! file_exists( $test_root . '/includes/phpunit6/compat.php' ) ) { // WordPress versions before 4.8 will be incompatible with newer PHPUnit versions. if ( version_compare( getenv( 'WP_VERSION' ), '4.8', '<' ) && class_exists( 'PHPUnit\Runner\Version' ) ) { require_once dirname( __FILE__ ) . '/phpunit6-compat.php';