Ticket #21459: 21459-no-switched-ut.diff
| File 21459-no-switched-ut.diff, 2.4 KB (added by , 13 years ago) |
|---|
-
tests/post/objects.php
54 54 $this->assertInternalType( 'array', $post_std ); 55 55 $post_std = (object) $post_std; 56 56 $GLOBALS['post'] = $post_std; 57 $pid = null; 58 $post = get_post( $pid ); 57 $post = get_post( null ); 59 58 $this->assertInstanceOf( 'WP_Post', $post ); 60 59 $this->assertEquals( $id, $post->ID ); 61 60 unset( $GLOBALS['post'] ); 61 62 // If no global post and passing empty value, expect null. 63 $this->assertNull( get_post( null ) ); 64 $this->assertNull( get_post( 0 ) ); 65 $this->assertNull( get_post( '' ) ); 66 $this->assertNull( get_post( false ) ); 62 67 } 63 68 64 69 function test_get_post_ancestors() { -
tests/ms.php
351 351 } 352 352 353 353 function test_switch_restore_blog() { 354 global $_wp_switched , $_wp_switched_stack, $wpdb;354 global $_wp_switched_stack, $wpdb; 355 355 356 356 $this->assertEquals( array(), $_wp_switched_stack ); 357 $this->assertFalse( $_wp_switched);357 $this->assertFalse( ms_is_switched() ); 358 358 $current_blog_id = get_current_blog_id(); 359 359 $this->assertInternalType( 'integer', $current_blog_id ); 360 360 … … 378 378 379 379 switch_to_blog( $blog_id ); 380 380 $this->assertEquals( array( $current_blog_id ), $_wp_switched_stack ); 381 $this->assertTrue( $_wp_switched);381 $this->assertTrue( ms_is_switched() ); 382 382 $this->assertEquals( $blog_id, $wpdb->blogid ); 383 383 $this->assertFalse( wp_cache_get( 'switch-test', 'switch-test' ) ); 384 384 wp_cache_set( 'switch-test', $blog_id, 'switch-test' ); … … 386 386 387 387 switch_to_blog( $blog_id ); 388 388 $this->assertEquals( array( $current_blog_id, $blog_id ), $_wp_switched_stack ); 389 $this->assertTrue( $_wp_switched);389 $this->assertTrue( ms_is_switched() ); 390 390 $this->assertEquals( $blog_id, $wpdb->blogid ); 391 391 $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) ); 392 392 … … 399 399 restore_current_blog(); 400 400 $this->assertEquals( $current_blog_id, get_current_blog_id() ); 401 401 $this->assertEquals( array(), $_wp_switched_stack ); 402 $this->assertFalse( $_wp_switched);402 $this->assertFalse( ms_is_switched() ); 403 403 $this->assertEquals( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) ); 404 404 405 405 $this->assertFalse( restore_current_blog() );