Tests: Allow override of MULTISITE and SUBDOMAIN_INSTALL constants

Props rmccue.
Fixes #36567.


git-svn-id: https://develop.svn.wordpress.org/trunk@37266 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt 2016-04-20 16:51:58 +00:00
parent 26f2705558
commit f692459926

View File

@ -42,12 +42,10 @@ define( 'WP_MAX_MEMORY_LIMIT', -1 );
$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
if ( "1" == getenv( 'WP_MULTISITE' ) ||
( defined( 'WP_TESTS_MULTISITE') && WP_TESTS_MULTISITE ) ) {
$multisite = true;
} else {
$multisite = false;
}
// Should we run in multisite mode?
$multisite = '1' == getenv( 'WP_MULTISITE' );
$multisite = $multisite || ( defined( 'WP_TESTS_MULTISITE') && WP_TESTS_MULTISITE );
$multisite = $multisite || ( defined( 'MULTISITE' ) && MULTISITE );
// Override the PHPMailer
require_once( dirname( __FILE__ ) . '/mock-mailer.php' );
@ -57,8 +55,8 @@ system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/install.ph
if ( $multisite ) {
echo "Running as multisite..." . PHP_EOL;
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
defined( 'MULTISITE' ) or define( 'MULTISITE', true );
defined( 'SUBDOMAIN_INSTALL' ) or define( 'SUBDOMAIN_INSTALL', false );
$GLOBALS['base'] = '/';
} else {
echo "Running as single site... To run multisite, use -c tests/phpunit/multisite.xml" . PHP_EOL;