Changeset 48937 for trunk/tests/phpunit/tests/multisite/network.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/network.php
r47013 r48937 77 77 */ 78 78 function test_get_main_network_id_default() { 79 $this->assert Equals( 1, get_main_network_id() );79 $this->assertSame( 1, get_main_network_id() ); 80 80 } 81 81 … … 87 87 self::factory()->network->create(); 88 88 89 $this->assert Equals( 1, get_main_network_id() );89 $this->assertSame( 1, get_main_network_id() ); 90 90 } 91 91 … … 101 101 $current_site->id = (int) $id; 102 102 103 $this->assert Equals( 1, get_main_network_id() );103 $this->assertSame( 1, get_main_network_id() ); 104 104 } 105 105 … … 121 121 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->site} SET id=1 WHERE id=%d", $temp_id ) ); 122 122 123 $this->assert Equals( self::$different_network_id, $main_network_id );123 $this->assertSame( self::$different_network_id, $main_network_id ); 124 124 } 125 125 126 126 function test_get_main_network_id_filtered() { 127 127 add_filter( 'get_main_network_id', array( $this, '_get_main_network_id' ) ); 128 $this->assert Equals( 3, get_main_network_id() );128 $this->assertSame( 3, get_main_network_id() ); 129 129 remove_filter( 'get_main_network_id', array( $this, '_get_main_network_id' ) ); 130 130 } … … 160 160 wp_update_network_counts(); 161 161 162 $this->assert Equals( $site_count_start + 1, $actual );162 $this->assertSame( $site_count_start + 1, $actual ); 163 163 } 164 164 … … 247 247 $count = get_user_count(); 248 248 249 $this->assert Equals( $start_count, $count );249 $this->assertSame( $start_count, $count ); 250 250 251 251 wp_update_network_counts(); … … 269 269 activate_plugin( $path ); // Enable the plugin for the current site. 270 270 $active_plugins = wp_get_active_network_plugins(); 271 $this->assert Equals( array(), $active_plugins );271 $this->assertSame( array(), $active_plugins ); 272 272 273 273 add_action( 'deactivated_plugin', array( $this, '_helper_deactivate_hook' ) ); … … 276 276 activate_plugin( $path, '', true ); // Enable the plugin for all sites in the network. 277 277 $active_plugins = wp_get_active_network_plugins(); 278 $this->assert Equals( array( WP_PLUGIN_DIR . '/hello.php' ), $active_plugins );278 $this->assertSame( array( WP_PLUGIN_DIR . '/hello.php' ), $active_plugins ); 279 279 280 280 // Deactivate the plugin. 281 281 deactivate_plugins( $path ); 282 282 $active_plugins = wp_get_active_network_plugins(); 283 $this->assert Equals( array(), $active_plugins );284 285 $this->assert Equals( 1, $this->plugin_hook_count ); // Testing actions and silent mode.283 $this->assertSame( array(), $active_plugins ); 284 285 $this->assertSame( 1, $this->plugin_hook_count ); // Testing actions and silent mode. 286 286 287 287 activate_plugin( $path, '', true ); // Enable the plugin for all sites in the network. 288 288 deactivate_plugins( $path, true ); // Silent mode. 289 289 290 $this->assert Equals( 1, $this->plugin_hook_count ); // Testing actions and silent mode.290 $this->assertSame( 1, $this->plugin_hook_count ); // Testing actions and silent mode. 291 291 } 292 292 … … 303 303 $active_plugins = wp_get_active_network_plugins(); 304 304 $this->assertCount( 1, $active_plugins ); 305 $this->assert Equals( 1, $mock->get_call_count() );305 $this->assertSame( 1, $mock->get_call_count() ); 306 306 307 307 // Should do nothing on the second try. … … 309 309 $active_plugins = wp_get_active_network_plugins(); 310 310 $this->assertCount( 1, $active_plugins ); 311 $this->assert Equals( 1, $mock->get_call_count() );311 $this->assertSame( 1, $mock->get_call_count() ); 312 312 313 313 remove_action( 'activate_' . $path, array( $mock, 'action' ) ); … … 338 338 339 339 $count = get_user_count(); // No change, cache not refreshed. 340 $this->assert Equals( $start_count, $count );340 $this->assertSame( $start_count, $count ); 341 341 342 342 wp_update_network_counts(); // Magic happens here. … … 393 393 394 394 $result = get_blog_count(); 395 $this->assert Equals( $expected, $result );395 $this->assertSame( $expected, $result ); 396 396 } 397 397 … … 405 405 406 406 $result = get_blog_count( self::$different_network_id ); 407 $this->assert Equals( 3, $result );407 $this->assertSame( 3, $result ); 408 408 } 409 409 … … 421 421 422 422 $result = get_user_count(); 423 $this->assert Equals( $expected, $result );423 $this->assertSame( $expected, $result ); 424 424 } 425 425 … … 437 437 438 438 $result = get_user_count( self::$different_network_id ); 439 $this->assert Equals( $expected, $result );439 $this->assertSame( $expected, $result ); 440 440 } 441 441 … … 597 597 wpmu_delete_blog( $site_id, true ); 598 598 599 $this->assert Equals( $original_count + 1, $result );599 $this->assertSame( $original_count + 1, $result ); 600 600 } 601 601 … … 633 633 634 634 // Double-check we got the ID of the new network correct. 635 $this->assert Equals( $new_network_id, $new_network->id );635 $this->assertSame( $new_network_id, $new_network->id ); 636 636 637 637 // Verify that if we fetch the network now, it's no longer false. 638 638 $fetched_network = get_network( $new_network_id ); 639 639 $this->assertInstanceOf( 'WP_Network', $fetched_network ); 640 $this->assert Equals( $new_network_id, $fetched_network->id );640 $this->assertSame( $new_network_id, $fetched_network->id ); 641 641 } 642 642
Note: See TracChangeset
for help on using the changeset viewer.