Changeset 38681 for trunk/tests/phpunit/tests/multisite/bootstrap.php
- Timestamp:
- 09/30/2016 04:09:45 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/bootstrap.php
r37475 r38681 209 209 } 210 210 211 /** 212 * @ticket 37053 213 */ 214 public function test_get_site_by_path_returns_wp_site() { 215 add_filter( 'pre_get_site_by_path', array( $this, 'filter_pre_get_site_by_path' ), 10, 3 ); 216 217 $site = get_site_by_path( 'example.com', '/foo/' ); 218 219 remove_filter( 'pre_get_site_by_path', array( $this, 'filter_pre_get_site_by_path' ), 10 ); 220 221 $this->assertInstanceOf( 'WP_Site', $site ); 222 } 223 211 224 public function filter_path_segments_to_two() { 212 225 return 2; 213 226 } 227 228 public function filter_pre_get_site_by_path( $site, $domain, $path ) { 229 $site = new stdClass(); 230 $site->blog_id = 100; 231 $site->domain = $domain; 232 $site->path = $path; 233 $site->site_id = 1; 234 235 return $site; 236 } 214 237 } 215 238
Note: See TracChangeset
for help on using the changeset viewer.