Changeset 52010 for trunk/tests/phpunit/tests/multisite/network.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/network.php
r51869 r52010 15 15 protected static $different_site_ids = array(); 16 16 17 function tear_down() {17 public function tear_down() { 18 18 global $current_site; 19 19 $current_site->id = 1; … … 68 68 * By default, only one network exists and has a network ID of 1. 69 69 */ 70 function test_get_main_network_id_default() {70 public function test_get_main_network_id_default() { 71 71 $this->assertSame( 1, get_main_network_id() ); 72 72 } … … 76 76 * as the main network ID. 77 77 */ 78 function test_get_main_network_id_two_networks() {78 public function test_get_main_network_id_two_networks() { 79 79 self::factory()->network->create(); 80 80 … … 86 86 * main network should still return as 1. 87 87 */ 88 function test_get_main_network_id_after_network_switch() {88 public function test_get_main_network_id_after_network_switch() { 89 89 global $current_site; 90 90 … … 103 103 * fake the process with UPDATE queries. 104 104 */ 105 function test_get_main_network_id_after_network_delete() {105 public function test_get_main_network_id_after_network_delete() { 106 106 global $wpdb, $current_site; 107 107 … … 116 116 } 117 117 118 function test_get_main_network_id_filtered() {119 add_filter( 'get_main_network_id', array( $this, ' _get_main_network_id' ) );118 public function test_get_main_network_id_filtered() { 119 add_filter( 'get_main_network_id', array( $this, 'get_main_network_id' ) ); 120 120 $this->assertSame( 3, get_main_network_id() ); 121 remove_filter( 'get_main_network_id', array( $this, ' _get_main_network_id' ) );122 } 123 124 function _get_main_network_id() {121 remove_filter( 'get_main_network_id', array( $this, 'get_main_network_id' ) ); 122 } 123 124 public function get_main_network_id() { 125 125 return 3; 126 126 } … … 129 129 * @ticket 37050 130 130 */ 131 function test_wp_network_object_id_property_is_int() {131 public function test_wp_network_object_id_property_is_int() { 132 132 $id = self::factory()->network->create(); 133 133 … … 226 226 * @ticket 22917 227 227 */ 228 function test_enable_live_network_user_counts_filter() {228 public function test_enable_live_network_user_counts_filter() { 229 229 // False for large networks by default. 230 230 add_filter( 'enable_live_network_counts', '__return_false' ); … … 255 255 } 256 256 257 function test_active_network_plugins() {257 public function test_active_network_plugins() { 258 258 $path = 'hello.php'; 259 259 … … 263 263 $this->assertSame( array(), $active_plugins ); 264 264 265 add_action( 'deactivated_plugin', array( $this, ' _helper_deactivate_hook' ) );265 add_action( 'deactivated_plugin', array( $this, 'helper_deactivate_hook' ) ); 266 266 267 267 // Activate the plugin sitewide. … … 286 286 * @ticket 28651 287 287 */ 288 function test_duplicate_network_active_plugin() {288 public function test_duplicate_network_active_plugin() { 289 289 $path = 'hello.php'; 290 290 $mock = new MockAction(); … … 306 306 } 307 307 308 function test_is_plugin_active_for_network_true() {308 public function test_is_plugin_active_for_network_true() { 309 309 activate_plugin( 'hello.php', '', true ); 310 310 $this->assertTrue( is_plugin_active_for_network( 'hello.php' ) ); 311 311 } 312 312 313 function test_is_plugin_active_for_network_false() {313 public function test_is_plugin_active_for_network_false() { 314 314 deactivate_plugins( 'hello.php', false, true ); 315 315 $this->assertFalse( is_plugin_active_for_network( 'hello.php' ) ); 316 316 } 317 317 318 function _helper_deactivate_hook() {318 public function helper_deactivate_hook() { 319 319 $this->plugin_hook_count++; 320 320 } 321 321 322 function test_get_user_count() {322 public function test_get_user_count() { 323 323 // Refresh the cache. 324 324 wp_update_network_counts(); … … 339 339 } 340 340 341 function test_wp_schedule_update_network_counts() {341 public function test_wp_schedule_update_network_counts() { 342 342 $this->assertFalse( wp_next_scheduled( 'update_network_counts' ) ); 343 343 … … 351 351 * @expectedDeprecated get_dashboard_blog 352 352 */ 353 function test_get_dashboard_blog() {353 public function test_get_dashboard_blog() { 354 354 // If there is no dashboard blog set, current blog is used. 355 355 $dashboard_blog = get_dashboard_blog(); … … 369 369 * @ticket 37528 370 370 */ 371 function test_wp_update_network_site_counts() {371 public function test_wp_update_network_site_counts() { 372 372 update_network_option( null, 'blog_count', 40 ); 373 373 … … 391 391 * @ticket 37528 392 392 */ 393 function test_wp_update_network_site_counts_on_different_network() {393 public function test_wp_update_network_site_counts_on_different_network() { 394 394 update_network_option( self::$different_network_id, 'blog_count', 40 ); 395 395
Note: See TracChangeset
for help on using the changeset viewer.