mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-24 15:24:36 +00:00
During PHPUnit tests, don't autodetect permalink structure during WP installation.
The unit tests expect non-pretty permalinks, so there's no benefit to detecting the ability to have pretty permalinks. Moreover, the `wp_remote_get()` call can cause installation to hang when there are DNS issues. Fixes #31994. git-svn-id: https://develop.svn.wordpress.org/trunk@32139 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -44,8 +44,17 @@ foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) {
|
||||
$wpdb->$table = $prefixed_table;
|
||||
}
|
||||
|
||||
// Prefill a permalink structure so that WP doesn't try to determine one itself.
|
||||
add_action( 'populate_options', '_set_default_permalink_structure_for_tests' );
|
||||
|
||||
wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password' );
|
||||
|
||||
// Delete dummy permalink structure, as prefilled above.
|
||||
if ( ! is_multisite() ) {
|
||||
delete_option( 'permalink_structure' );
|
||||
}
|
||||
remove_action( 'populate_options', '_set_default_permalink_structure_for_tests' );
|
||||
|
||||
if ( $multisite ) {
|
||||
echo "Installing network..." . PHP_EOL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user