WordPress.org

Make WordPress Core

Changeset 728 in tests


Ignore:
Timestamp:
05/30/12 15:34:17 (23 months ago)
Author:
nacin
Message:

Update MS tests.

  • Ensure the is_user_member_of_blog() test runs.
  • Assert that after deletion, the user no longer exists. see #WP20792
  • Update expected return value for get_blogs_of_user() to always be an array. see #WP19500
  • Two failures on the exists() checks, without the patch on #WP20792.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_ms.php

    r672 r728  
    7777 
    7878        // Logged out users don't have blogs. 
    79         $this->assertFalse( get_blogs_of_user( 0 ) ); 
     79        $this->assertEquals( array(), get_blogs_of_user( 0 ) ); 
    8080 
    8181        $user1_id = $this->_make_user('administrator'); 
     
    100100        // Non-existent users don't have blogs. 
    101101        wpmu_delete_user( $user1_id ); 
    102         $this->assertFalse( get_blogs_of_user( $user1_id ) ); 
     102        $user = new WP_User( $user1_id ); 
     103        $this->assertFalse( $user->exists(), 'WP_User->exists' ); 
     104        $this->assertEquals( array(), get_blogs_of_user( $user1_id ) ); 
    103105 
    104106        foreach ( $blog_ids as $blog_id )  
     
    137139    } 
    138140 
    139     function is_user_member_of_blog() { 
     141    function test_is_user_member_of_blog() { 
    140142        global $current_site, $wpdb; 
    141143 
     
    166168 
    167169        wpmu_delete_user( $user1_id ); 
    168         $this->assertFalse( is_user_member_of_blog( $user1_id ) ); 
     170        $user = new WP_User( $user1_id ); 
     171        $this->assertFalse( $user->exists(), 'WP_User->exists' ); 
     172        $this->assertFalse( is_user_member_of_blog( $user1_id ), 'is_user_member_of_blog' ); 
    169173 
    170174        wp_set_current_user( $old_current ); 
Note: See TracChangeset for help on using the changeset viewer.