Make WordPress Core

Ticket #36567: 36567.diff

File 36567.diff, 1.2 KB (added by rmccue, 8 years ago)

Allow overriding constants in config

  • tests/phpunit/includes/bootstrap.php

     
    4242
    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
    5351require_once( dirname( __FILE__ ) . '/mock-mailer.php' );
     
    5755
    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 {
    6462        echo "Running as single site... To run multisite, use -c tests/phpunit/multisite.xml" . PHP_EOL;