Skip to:
Content

BuddyPress.org

Ticket #8381: 8381.3.patch

File 8381.3.patch, 2.4 KB (added by imath, 5 years ago)

It should fix Travis fails

  • .travis.yml

    diff --git .travis.yml .travis.yml
    index 8c065b9e8..a89729851 100644
    php: 
    2727# x.y mirrors the latest from the x.y branch
    2828env:
    2929  - WP_VERSION=master BP_TRAVISCI=travis:phpunit
     30  - WP_VERSION=5.7 BP_TRAVISCI=travis:phpunit
    3031  - WP_VERSION=5.6 BP_TRAVISCI=travis:phpunit
    3132  - WP_VERSION=5.5 BP_TRAVISCI=travis:phpunit
    3233  - WP_VERSION=5.4 BP_TRAVISCI=travis:phpunit
    before_install: 
    9899
    99100# before_script: Failures in this section will result in build status 'errored'
    100101before_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
    104102  - mkdir -p /tmp/node/node_modules
    105103  - ln -s /tmp/node/node_modules $plugin_dir/node_modules
    106   - npm install
     104  - if [[ $BP_TRAVISCI != "travis:phpunit" ]]; then npm install; fi
    107105
    108106# Run tests
    109107script: grunt $BP_TRAVISCI
  • Gruntfile.js

    diff --git Gruntfile.js Gruntfile.js
    index 9a184513d..61480c710 100644
    module.exports = function( grunt ) { 
    323323                },
    324324                phpunit: {
    325325                        'default': {
    326                                 cmd: 'phpunit',
     326                                cmd: './vendor/phpunit/phpunit/phpunit',
    327327                                args: ['-c', 'phpunit.xml.dist']
    328328                        },
    329329                        'multisite': {
    330                                 cmd: 'phpunit',
     330                                cmd: './vendor/phpunit/phpunit/phpunit',
    331331                                args: ['-c', 'tests/phpunit/multisite.xml']
    332332                        },
    333333                        'codecoverage': {
    334                                 cmd: 'phpunit',
     334                                cmd: './vendor/phpunit/phpunit/phpunit',
    335335                                args: ['-c', 'tests/phpunit/codecoverage.xml' ]
    336336                        }
    337337                },
  • tests/phpunit/includes/define-constants.php

    diff --git tests/phpunit/includes/define-constants.php tests/phpunit/includes/define-constants.php
    index a2805a73a..6b40b4684 100644
    if ( ! defined( 'BP_TESTS_DIR' ) ) { 
    2020 * - Assume that we are inside of a develop.svn.wordpress.org setup, and walk
    2121 *   up the directory tree
    2222 */
    23 if ( false !== getenv( 'WP_PHPUNIT__DIR' ) ) {
     23if ( false !== getenv( 'WP_PHPUNIT__DIR' ) && defined( 'BP_USE_WP_ENV_TESTS' ) ) {
    2424        define( 'WP_TESTS_DIR', getenv( 'WP_PHPUNIT__DIR' ) );
    2525        define( 'WP_ROOT_DIR', '/var/www/html' );
    2626} elseif ( false !== getenv( 'WP_TESTS_DIR' ) ) {