WordPress.org

Make WordPress Core

Changeset 1009 in tests


Ignore:
Timestamp:
09/05/12 20:12:41 (20 months ago)
Author:
ryan
Message:

Make sure cap_key for the current user is updated when the blog is switched. see #WP21459

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/ms.php

    r1007 r1009  
    365365        $blog_id = $this->factory->blog->create( array( 'user_id' => $user_id, 'path' => '/test_blogpath', 'title' => 'Test Title' ) ); 
    366366 
     367        $cap_key = wp_get_current_user()->cap_key; 
    367368        switch_to_blog( $blog_id ); 
     369        $this->assertNotEquals( $cap_key, wp_get_current_user()->cap_key ); 
    368370        $this->assertEquals( array( $current_blog_id ), $_wp_switched_stack ); 
    369371        $this->assertTrue( ms_is_switched() ); 
     
    386388 
    387389        restore_current_blog(); 
     390        $this->assertEquals( $cap_key, wp_get_current_user()->cap_key ); 
    388391        $this->assertEquals( $current_blog_id, get_current_blog_id() ); 
    389392        $this->assertEquals( array(), $_wp_switched_stack ); 
Note: See TracChangeset for help on using the changeset viewer.