| 559 | |
| 560 | function test_is_main_site() { |
| 561 | $this->assertTrue( is_main_site() ); |
| 562 | $this->assertTrue( is_main_site( get_current_blog_id() ) ); |
| 563 | |
| 564 | $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); |
| 565 | $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id ) ); |
| 566 | |
| 567 | switch_to_blog( $blog_id ); |
| 568 | $this->assertFalse( is_main_site( $blog_id ) ); |
| 569 | $this->assertFalse( is_main_site( get_current_blog_id() ) ); |
| 570 | $this->assertFalse( is_main_site() ); |
| 571 | |
| 572 | restore_current_blog(); |
| 573 | } |