Changeset 40342 for trunk/tests/phpunit/tests/multisite/bootstrap.php
- Timestamp:
- 03/28/2017 01:24:44 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/bootstrap.php
r40102 r40342 95 95 /** 96 96 * @ticket 37217 97 * @dataProvider data_get_network_by_path_ not_using_paths97 * @dataProvider data_get_network_by_path_with_zero_path_segments 98 98 * 99 99 * @param string $expected_key The array key associated with expected data for the test. … … 102 102 * @param string $message The message to pass for failed tests. 103 103 */ 104 public function test_get_network_by_path_not_using_paths( $expected_key, $domain, $path, $message ) { 105 if ( ! wp_using_ext_object_cache() ) { 106 $this->markTestSkipped( 'Only testable with an external object cache.' ); 107 } 108 109 // Temporarily store original object cache and using paths values. 110 $using_paths_orig = wp_cache_get( 'networks_have_paths', 'site-options' ); 111 112 wp_cache_set( 'networks_have_paths', 0, 'site-options' ); 104 public function test_get_network_by_path_with_zero_path_segments( $expected_key, $domain, $path, $message ) { 105 add_filter( 'network_by_path_segments_count', '__return_zero' ); 113 106 114 107 $network = get_network_by_path( $domain, $path ); 115 108 116 // Restore original object cache and using paths values. 117 wp_cache_set( 'networks_have_paths', $using_paths_orig, 'site-options' ); 109 remove_filter( 'network_by_path_segments_count', '__return_zero' ); 118 110 119 111 $this->assertEquals( self::$network_ids[ $expected_key ], $network->id, $message ); 120 112 } 121 113 122 public function data_get_network_by_path_ not_using_paths() {114 public function data_get_network_by_path_with_zero_path_segments() { 123 115 return array( 124 116 array( 'wordpress.org/', 'wordpress.org', '/', 'A standard domain and path request should work.' ),
Note: See TracChangeset
for help on using the changeset viewer.