WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/20/2016 04:51:58 PM (4 years ago)
Author:
jeremyfelt
Message:

Tests: Allow override of MULTISITE and SUBDOMAIN_INSTALL constants

Props rmccue.
Fixes #36567.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/bootstrap.php

    r36721 r37266  
    4343$PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php';
    4444
    45 if ( "1" == getenv( 'WP_MULTISITE' ) ||
    46     ( defined( 'WP_TESTS_MULTISITE') && WP_TESTS_MULTISITE ) ) {
    47     $multisite = true;
    48 } else {
    49     $multisite = false;
    50 }
     45// Should we run in multisite mode?
     46$multisite = '1' == getenv( 'WP_MULTISITE' );
     47$multisite = $multisite || ( defined( 'WP_TESTS_MULTISITE') && WP_TESTS_MULTISITE );
     48$multisite = $multisite || ( defined( 'MULTISITE' ) && MULTISITE );
    5149
    5250// Override the PHPMailer
     
    5856if ( $multisite ) {
    5957    echo "Running as multisite..." . PHP_EOL;
    60     define( 'MULTISITE', true );
    61     define( 'SUBDOMAIN_INSTALL', false );
     58    defined( 'MULTISITE' ) or define( 'MULTISITE', true );
     59    defined( 'SUBDOMAIN_INSTALL' ) or define( 'SUBDOMAIN_INSTALL', false );
    6260    $GLOBALS['base'] = '/';
    6361} else {
Note: See TracChangeset for help on using the changeset viewer.