From 4351e822458fca6faeee5cfddb29f65cdf3d68c3 Mon Sep 17 00:00:00 2001 From: David Hickman Date: Thu, 4 Apr 2019 12:19:19 -0500 Subject: [PATCH] * Use cgr to avoid dependency conflicts * Update Path to core phpunit6-compat.php --- .travis.yml | 10 +++++++--- tests/phpunit/bootstrap.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53c9522..f84f54c 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..99238ec 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( '/tmp/wordpress-tests-lib/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';