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
This commit is contained in:
Aaron Jorbin 2020-06-03 21:02:42 +00:00
parent f9a4cdcb3c
commit 42efaab548
1 changed files with 6 additions and 1 deletions

View File

@ -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( '' );
}