Ticket #22090: 22090-ut.diff
File 22090-ut.diff, 1.3 KB (added by , 12 years ago) |
---|
-
tests/ms.php
358 358 $this->assertEquals( $current_site->domain, $blog->domain ); 359 359 $this->assertEquals( '/', $blog->path ); 360 360 361 // Test defaulting to current blog 362 $this->assertEquals( $blog, get_blog_details() ); 363 361 364 $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); 362 365 $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/test_blogname', 'title' => 'Test Title' ) ); 363 366 $this->assertInternalType( 'int', $blog_id ); … … 556 559 $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) ); 557 560 $this->assertEquals( 0, get_blog_id_from_url( $details->domain, $details->path ) ); 558 561 } 562 563 function test_is_main_site() { 564 $this->assertTrue( is_main_site() ); 565 $this->assertTrue( is_main_site( get_current_blog_id() ) ); 566 567 $user_id = $this->factory->user->create( array( 'role' => 'administrator' ) ); 568 $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id ) ); 569 570 switch_to_blog( $blog_id ); 571 $this->assertFalse( is_main_site( $blog_id ) ); 572 $this->assertFalse( is_main_site( get_current_blog_id() ) ); 573 $this->assertFalse( is_main_site() ); 574 575 restore_current_blog(); 576 } 559 577 } 560 578 561 579 endif;