Build/Test Tools: Allow the unit test framework to be used without the data directory in place.

Fixes #43982

Merges [43315] to the 4.9 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43316 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2018-05-25 22:47:39 +00:00
parent f27af570cd
commit e86a6dfdb5

View File

@ -63,7 +63,11 @@ $phpmailer = new MockPHPMailer( true );
if ( ! defined( 'WP_DEFAULT_THEME' ) ) { if ( ! defined( 'WP_DEFAULT_THEME' ) ) {
define( 'WP_DEFAULT_THEME', 'default' ); define( 'WP_DEFAULT_THEME', 'default' );
} }
$wp_theme_directories = array( DIR_TESTDATA . '/themedir1' ); $wp_theme_directories = array();
if ( file_exists( DIR_TESTDATA . '/themedir1' ) ) {
$wp_theme_directories[] = DIR_TESTDATA . '/themedir1';
}
system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $multisite, $retval ); system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $multisite, $retval );
if ( 0 !== $retval ) { if ( 0 !== $retval ) {