Changeset 12712 for trunk/tests/phpunit/includes/define-constants.php
- Timestamp:
- 08/30/2020 05:53:06 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:global-ignores
-
old new 1 1 .DS_Store 2 2 .gitignore 3 .wp-env.override.json
-
- Property svn:global-ignores
-
trunk/tests/phpunit/includes/define-constants.php
r9819 r12712 21 21 * up the directory tree 22 22 */ 23 if ( false !== getenv( 'WP_TESTS_DIR' ) ) { 23 if ( false !== getenv( 'WP_PHPUNIT__DIR' ) ) { 24 define( 'WP_TESTS_DIR', getenv( 'WP_PHPUNIT__DIR' ) ); 25 define( 'WP_ROOT_DIR', '/var/www/html' ); 26 } elseif ( false !== getenv( 'WP_TESTS_DIR' ) ) { 24 27 define( 'WP_TESTS_DIR', getenv( 'WP_TESTS_DIR' ) ); 25 28 define( 'WP_ROOT_DIR', WP_TESTS_DIR ); … … 35 38 } 36 39 37 // Based on the tests directory, look for a config file 38 if ( file_exists( WP_ROOT_DIR . '/wp-tests-config.php' ) ) { 39 // Standard develop.svn.wordpress.org setup 40 define( 'WP_TESTS_CONFIG_PATH', WP_ROOT_DIR . '/wp-tests-config.php' ); 40 if ( ! defined( 'WP_TESTS_CONFIG_FILE_PATH' ) ) { 41 // Based on the tests directory, look for a config file 42 if ( file_exists( WP_ROOT_DIR . '/wp-tests-config.php' ) ) { 43 // Standard develop.svn.wordpress.org setup 44 define( 'WP_TESTS_CONFIG_PATH', WP_ROOT_DIR . '/wp-tests-config.php' ); 41 45 42 } elseif ( file_exists( WP_TESTS_DIR . '/wp-tests-config.php' ) ) {43 // Legacy unit-test.svn.wordpress.org setup44 define( 'WP_TESTS_CONFIG_PATH', WP_TESTS_DIR . '/wp-tests-config.php' );46 } elseif ( file_exists( WP_TESTS_DIR . '/wp-tests-config.php' ) ) { 47 // Legacy unit-test.svn.wordpress.org setup 48 define( 'WP_TESTS_CONFIG_PATH', WP_TESTS_DIR . '/wp-tests-config.php' ); 45 49 46 } elseif ( file_exists( dirname( dirname( WP_TESTS_DIR ) ) . '/wp-tests-config.php' ) ) {47 // Environment variable exists and points to tests/phpunit of48 // develop.svn.wordpress.org setup49 define( 'WP_TESTS_CONFIG_PATH', dirname( dirname( WP_TESTS_DIR ) ) . '/wp-tests-config.php' );50 } elseif ( file_exists( dirname( dirname( WP_TESTS_DIR ) ) . '/wp-tests-config.php' ) ) { 51 // Environment variable exists and points to tests/phpunit of 52 // develop.svn.wordpress.org setup 53 define( 'WP_TESTS_CONFIG_PATH', dirname( dirname( WP_TESTS_DIR ) ) . '/wp-tests-config.php' ); 50 54 51 } else { 52 die( "wp-tests-config.php could not be found.\n" ); 55 } else { 56 die( "wp-tests-config.php could not be found.\n" ); 57 } 53 58 }
Note: See TracChangeset
for help on using the changeset viewer.