Changeset 37475 for trunk/tests/phpunit/tests/multisite/bootstrap.php
- Timestamp:
- 05/20/2016 08:56:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/bootstrap.php
r37241 r37475 159 159 ); 160 160 161 $this->_setup_host_request( $domain, $path );161 ms_load_current_site_and_network( $domain, $path ); 162 162 $actual = array( 163 163 'network_id' => $current_blog->site_id, 164 164 'site_id' => $current_blog->blog_id, 165 165 ); 166 $this->_setup_host_request( WP_TESTS_DOMAIN, '/' );166 ms_load_current_site_and_network( WP_TESTS_DOMAIN, '/' ); 167 167 168 168 $this->assertEqualSetsWithIndex( $expected, $actual ); … … 198 198 ); 199 199 add_filter( 'site_by_path_segments_count', array( $this, 'filter_path_segments_to_two' ) ); 200 $this->_setup_host_request( 'wordpress.org', '/foo/bar/' );200 ms_load_current_site_and_network( 'wordpress.org', '/foo/bar/' ); 201 201 $actual = array( 202 202 'network_id' => $current_blog->site_id, … … 204 204 ); 205 205 remove_filter( 'site_by_path_segments_count', array( $this, 'filter_path_segments_to_two' ) ); 206 $this->_setup_host_request( WP_TESTS_DOMAIN, '/' );206 ms_load_current_site_and_network( WP_TESTS_DOMAIN, '/' ); 207 207 208 208 $this->assertEqualSetsWithIndex( $expected, $actual ); … … 212 212 return 2; 213 213 } 214 215 /**216 * Reset various globals required for a 'clean' multisite boot.217 *218 * The $wpdb and $table_prefix globals are required for ms-settings.php to219 * load properly.220 *221 * @param string $domain HTTP_HOST of the bootstrap request.222 * @param string $path REQUEST_URI of the boot strap request.223 */224 function _setup_host_request( $domain, $path ) {225 global $current_site, $current_blog, $table_prefix, $wpdb;226 227 $table_prefix = WP_TESTS_TABLE_PREFIX;228 $current_site = $current_blog = null;229 $_SERVER['HTTP_HOST'] = $domain;230 $_SERVER['REQUEST_URI'] = $path;231 232 include ABSPATH . '/wp-includes/ms-settings.php';233 }234 214 } 235 215
Note: See TracChangeset
for help on using the changeset viewer.