From 94201ff1f5185be29f1f8362619d4af8b92b6aef Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 25 Oct 2016 11:05:17 +0000 Subject: [PATCH] Tests: Fix a PHP notice introduced in [38907]. `WP_DEFAULT_THEME` was being defined in the wrong location. Also, if WordPress has the original "default" theme installed, ensure that our test theme overrides it. Props swissspidy for daring to dive into Themes of WordPress Past. See #31550, #38457. git-svn-id: https://develop.svn.wordpress.org/trunk@38908 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/bootstrap.php | 1 - tests/phpunit/includes/install.php | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 089cc59ef1..a5b3ed4908 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -53,7 +53,6 @@ $multisite = $multisite || ( defined( 'MULTISITE' ) && MULTISITE ); require_once( dirname( __FILE__ ) . '/mock-mailer.php' ); $phpmailer = new MockPHPMailer(); -// Set the theme to our special empty theme, to avoid interference from the current Twenty* theme. if ( ! defined( 'WP_DEFAULT_THEME' ) ) { define( 'WP_DEFAULT_THEME', 'default' ); } diff --git a/tests/phpunit/includes/install.php b/tests/phpunit/includes/install.php index 50efd43bd7..38db3ce55a 100644 --- a/tests/phpunit/includes/install.php +++ b/tests/phpunit/includes/install.php @@ -9,15 +9,14 @@ error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT ); $config_file_path = $argv[1]; $multisite = ! empty( $argv[2] ); +define( 'WP_INSTALLING', true ); +require_once $config_file_path; +require_once dirname( __FILE__ ) . '/functions.php'; + // Set the theme to our special empty theme, to avoid interference from the current Twenty* theme. if ( ! defined( 'WP_DEFAULT_THEME' ) ) { define( 'WP_DEFAULT_THEME', 'default' ); } -$wp_theme_directories = array( dirname( __FILE__ ) . '/../data/themedir1' ); - -define( 'WP_INSTALLING', true ); -require_once $config_file_path; -require_once dirname( __FILE__ ) . '/functions.php'; tests_reset__SERVER(); @@ -33,6 +32,8 @@ global $phpmailer; require_once( dirname( __FILE__ ) . '/mock-mailer.php' ); $phpmailer = new MockPHPMailer(); +register_theme_directory( dirname( __FILE__ ) . '/../data/themedir1' ); + /* * default_storage_engine and storage_engine are the same option, but storage_engine * was deprecated in MySQL (and MariaDB) 5.5.3, and removed in 5.7.