From 42efaab5489a615d8a2f4b32643d9fcde1f0a9d1 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Wed, 3 Jun 2020 21:02:42 +0000 Subject: [PATCH] Build/Test: Die with an error if populate_network fails If you are missing WP_TESTS_EMAIL, populate_network will fail and it can be hard to debug. As populate_network can return a wp_error object, we can detect that and display the error to a user. See: https://github.com/WordPress/gutenberg/pull/22613 Fixes: #50251 Props: TimothyBlynJacobs git-svn-id: https://develop.svn.wordpress.org/trunk@47904 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/install.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/install.php b/tests/phpunit/includes/install.php index 4ab457f48a..8ce307818d 100644 --- a/tests/phpunit/includes/install.php +++ b/tests/phpunit/includes/install.php @@ -92,6 +92,11 @@ if ( $multisite ) { $subdomain_install = false; install_network(); - populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install ); + $error = populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install ); + + if ( is_wp_error( $error ) ) { + wp_die( $error ); + } + $wp_rewrite->set_permalink_structure( '' ); }