Make WordPress Core


Ignore:
Timestamp:
06/03/2020 09:02:42 PM (5 years ago)
Author:
jorbin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/install.php

    r47496 r47904  
    9393
    9494    install_network();
    95     populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install );
     95    $error = populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install );
     96
     97    if ( is_wp_error( $error ) ) {
     98        wp_die( $error );
     99    }
     100
    96101    $wp_rewrite->set_permalink_structure( '' );
    97102}
Note: See TracChangeset for help on using the changeset viewer.