diff --git .travis.yml .travis.yml
index 8c065b9e8..a89729851 100644
|
|
|
php: |
| 27 | 27 | # x.y mirrors the latest from the x.y branch |
| 28 | 28 | env: |
| 29 | 29 | - WP_VERSION=master BP_TRAVISCI=travis:phpunit |
| | 30 | - WP_VERSION=5.7 BP_TRAVISCI=travis:phpunit |
| 30 | 31 | - WP_VERSION=5.6 BP_TRAVISCI=travis:phpunit |
| 31 | 32 | - WP_VERSION=5.5 BP_TRAVISCI=travis:phpunit |
| 32 | 33 | - WP_VERSION=5.4 BP_TRAVISCI=travis:phpunit |
| … |
… |
before_install: |
| 98 | 99 | |
| 99 | 100 | # before_script: Failures in this section will result in build status 'errored' |
| 100 | 101 | before_script: |
| 101 | | - if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then composer global require --dev phpunit/phpunit ^5; composer install; fi |
| 102 | | - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then composer global require --dev phpunit/phpunit ^6; composer install; fi |
| 103 | | - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" ]]; then composer global require --dev phpunit/phpunit ^6; composer install; fi |
| 104 | 102 | - mkdir -p /tmp/node/node_modules |
| 105 | 103 | - ln -s /tmp/node/node_modules $plugin_dir/node_modules |
| 106 | | - npm install |
| | 104 | - if [[ $BP_TRAVISCI != "travis:phpunit" ]]; then npm install; fi |
| 107 | 105 | |
| 108 | 106 | # Run tests |
| 109 | 107 | script: grunt $BP_TRAVISCI |
diff --git Gruntfile.js Gruntfile.js
index 9a184513d..61480c710 100644
|
|
|
module.exports = function( grunt ) { |
| 323 | 323 | }, |
| 324 | 324 | phpunit: { |
| 325 | 325 | 'default': { |
| 326 | | cmd: 'phpunit', |
| | 326 | cmd: './vendor/phpunit/phpunit/phpunit', |
| 327 | 327 | args: ['-c', 'phpunit.xml.dist'] |
| 328 | 328 | }, |
| 329 | 329 | 'multisite': { |
| 330 | | cmd: 'phpunit', |
| | 330 | cmd: './vendor/phpunit/phpunit/phpunit', |
| 331 | 331 | args: ['-c', 'tests/phpunit/multisite.xml'] |
| 332 | 332 | }, |
| 333 | 333 | 'codecoverage': { |
| 334 | | cmd: 'phpunit', |
| | 334 | cmd: './vendor/phpunit/phpunit/phpunit', |
| 335 | 335 | args: ['-c', 'tests/phpunit/codecoverage.xml' ] |
| 336 | 336 | } |
| 337 | 337 | }, |
diff --git tests/phpunit/includes/define-constants.php tests/phpunit/includes/define-constants.php
index a2805a73a..6b40b4684 100644
|
|
|
if ( ! defined( 'BP_TESTS_DIR' ) ) { |
| 20 | 20 | * - Assume that we are inside of a develop.svn.wordpress.org setup, and walk |
| 21 | 21 | * up the directory tree |
| 22 | 22 | */ |
| 23 | | if ( false !== getenv( 'WP_PHPUNIT__DIR' ) ) { |
| | 23 | if ( false !== getenv( 'WP_PHPUNIT__DIR' ) && defined( 'BP_USE_WP_ENV_TESTS' ) ) { |
| 24 | 24 | define( 'WP_TESTS_DIR', getenv( 'WP_PHPUNIT__DIR' ) ); |
| 25 | 25 | define( 'WP_ROOT_DIR', '/var/www/html' ); |
| 26 | 26 | } elseif ( false !== getenv( 'WP_TESTS_DIR' ) ) { |