Skip to content

Commit

Permalink
* Use cgr to avoid dependency conflicts
Browse files Browse the repository at this point in the history
* Update Path to core phpunit6-compat.php
  • Loading branch information
DavidHickman committed Apr 8, 2019
1 parent 95c1307 commit 4351e82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- |
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 4351e82

Please # to comment.