From e86a6dfdb5d4b32e52be17ed63cc1c9331b082c2 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 25 May 2018 22:47:39 +0000 Subject: [PATCH] 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 --- tests/phpunit/includes/bootstrap.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index f93d6bee89..c3b52cc553 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -63,7 +63,11 @@ $phpmailer = new MockPHPMailer( true ); if ( ! defined( 'WP_DEFAULT_THEME' ) ) { 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 ); if ( 0 !== $retval ) {