diff --git tests/phpunit/includes/functions.php tests/phpunit/includes/functions.php
index e8d30cb..c57983b 100644
|
|
function _wp_die_handler_txt( $message, $title, $args ) { |
102 | 102 | echo "\t $k : $v\n"; |
103 | 103 | } |
104 | 104 | } |
105 | | } |
106 | | No newline at end of file |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Set a permalink structure. |
| 109 | * |
| 110 | * Hooked as a callback to the 'populate_options' action, we use this function to set a permalink structure during |
| 111 | * `wp_install()`, so that WP doesn't attempt to do a time-consuming remote request. |
| 112 | */ |
| 113 | function _set_default_permalink_structure_for_tests() { |
| 114 | update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/' ); |
| 115 | } |
diff --git tests/phpunit/includes/install.php tests/phpunit/includes/install.php
index ff4090e..8a07a72 100644
|
|
foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) { |
44 | 44 | $wpdb->$table = $prefixed_table; |
45 | 45 | } |
46 | 46 | |
| 47 | // Preset a permalink structure so that WP doesn't try to determine one itself. |
| 48 | add_action( 'populate_options', '_set_default_permalink_structure_for_tests' ); |
| 49 | |
47 | 50 | wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password' ); |
48 | 51 | |
| 52 | // Delete dummy permalink structure. |
| 53 | if ( ! is_multisite() ) { |
| 54 | delete_option( 'permalink_structure' ); |
| 55 | } |
| 56 | remove_action( 'populate_options', '_set_default_permalink_structure_for_tests' ); |
| 57 | |
49 | 58 | if ( $multisite ) { |
50 | 59 | echo "Installing network..." . PHP_EOL; |
51 | 60 | |