Ticket #5708: 5708.patch
| File 5708.patch, 4.4 KB (added by , 11 years ago) |
|---|
-
.travis.yml
1 # Travis CI Configuration File 2 3 # Tell Travis CI we're using PHP 1 4 language: php 2 5 6 # PHP version used in first build configuration. 3 7 php: 4 8 - 5.2 5 9 - 5.3 … … 6 10 - 5.4 7 11 - 5.5 8 12 13 # WordPress versions uses Git 'develop' repo branches 9 14 env: 10 - WP_VERSION= trunk11 - WP_VERSION= tags/3.912 - WP_VERSION= tags/3.8.313 - WP_VERSION= tags/3.7.315 - WP_VERSION=master # Git equivalent of SVN /trunk 16 - WP_VERSION=3.9 # Includes latest 3.9.x release 17 - WP_VERSION=3.8 # Includes latest 3.8.x release 18 - WP_VERSION=3.7 # Includes latest 3.7.x release 14 19 20 # Build matrix options 15 21 matrix: 16 22 include: 17 23 - php: 5.6 18 env: WP_VERSION=trunk 24 env: WP_VERSION=master 25 - php: hhvm 26 env: WP_VERSION=master 19 27 allow_failures: 20 28 - php: 5.6 29 - php: hhvm 30 fast_finish: true 21 31 22 before_script: 23 # set up WP install 24 - WP_CORE_DIR=/tmp/wordpress/25 - mkdir -p $WP_CORE_DIR26 - svn co --ignore-externals https://develop.svn.wordpress.org/$WP_VERSION $WP_CORE_DIR27 - plugin_slug=$(basename $(pwd))28 - plugin_dir=$WP_CORE_DIR/src/wp-content/plugins/$plugin_slug29 - cd ..30 - mv $plugin_slug $plugin_dir31 # set up tests config32 - cd $WP_CORE_DIR32 # Before install, failures in this section will result in build status 'errored' 33 before_install: 34 # setup WP_DEVELOP_DIR (needed for BuddyPress to bootstrap WP PHPUnit tests) 35 - WP_DEVELOP_DIR=/tmp/wordpress 36 # clone the WordPress develop repo 37 - git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR 38 - mv $TRAVIS_BUILD_DIR /tmp/wordpress/src/wp-content/plugins/buddypress 39 - cd $WP_DEVELOP_DIR 40 # setub db 41 - mysql -e "CREATE DATABASE wordpress_test;" -uroot 42 # setub wp-config 33 43 - cp wp-tests-config-sample.php wp-tests-config.php 34 44 - sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php 35 45 - sed -i "s/yourusernamehere/root/" wp-tests-config.php 36 46 - sed -i "s/yourpasswordhere//" wp-tests-config.php 37 # disable WP_DEBUG for PHP 5.5 due to ext/mysqli E_DEPRECATED errors38 - if [ [ "$TRAVIS_PHP_VERSION" == 5.5* ]]; then sed -i "s:define( 'WP_DEBUG://define( 'WP_DEBUG:" wp-tests-config.php; fi;39 # set up database40 - mysql -e 'CREATE DATABASE wordpress_test;' -uroot41 # prepare for running the tests42 - cd $plugin_dir47 # disable WP_DEBUG for PHP 5.5 and WordPress 3.7 branch due to ext/mysqli E_DEPRECATED errors 48 - if [ "$TRAVIS_PHP_VERSION" == "5.5" ] && [ "$WP_VERSION" == "3.7" ]; then sed -i "s:define( 'WP_DEBUG://define( 'WP_DEBUG:" wp-tests-config.php; fi; 49 # prepare for running BuddyPress' tests 50 - BP_DEVELOP_DIR=$WP_DEVELOP_DIR/src/wp-content/plugins/buddypress 51 - cd $BP_DEVELOP_DIR 52 # 'build' BuddyPress 43 53 - npm install -g grunt-cli 54 55 # Before script, failures in this section will result in build status 'failed' 56 before_script: 44 57 - npm install 45 58 46 59 script: grunt travis -
tests/phpunit/includes/define-constants.php
23 23 if ( false !== getenv( 'WP_TESTS_DIR' ) ) { 24 24 define( 'WP_TESTS_DIR', getenv( 'WP_TESTS_DIR' ) ); 25 25 define( 'WP_ROOT_DIR', WP_TESTS_DIR ); 26 } else {27 // Support WP_DEVELOP_DIR, as used by some plugins28 if ( false !== getenv( 'WP_DEVELOP_DIR' ) ) {29 define( 'WP_ROOT_DIR', getenv( 'WP_DEVELOP_DIR' ) );30 } else {31 define( 'WP_ROOT_DIR', dirname( dirname( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ) ) );32 }33 26 27 // Support WP_DEVELOP_DIR, as used by some plugins 28 } else if ( false !== getenv( 'WP_DEVELOP_DIR' ) ) { 29 define( 'WP_ROOT_DIR', getenv( 'WP_DEVELOP_DIR' ) ); 34 30 define( 'WP_TESTS_DIR', WP_ROOT_DIR . '/tests/phpunit' ); 31 32 // Support Travis CI build environment 33 } else if ( false !== getenv( 'TRAVIS' ) ) { 34 define( 'WP_ROOT_DIR', '/tmp/wordpress' ); 35 define( 'WP_TESTS_DIR', WP_ROOT_DIR . '/tests/phpunit' ); 36 37 } else { 38 define( 'WP_ROOT_DIR', dirname( dirname( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ) ) ); 39 define( 'WP_TESTS_DIR', WP_ROOT_DIR . '/tests/phpunit' ); 35 40 } 36 41 37 42 // Based on the tests directory, look for a config file