WordPress.org

Make WordPress Core

Changeset 1117 in tests


Ignore:
Timestamp:
11/07/12 17:17:40 (18 months ago)
Author:
ryan
Message:

Test case for WP_User::set_role(). see #WP18932

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/user/capabilities.php

    r1091 r1117  
    618618        $this->assertFalse ( isset( $author->caps['foo'] ) ); 
    619619    } 
     620 
     621    /** 
     622     * @ticket 18932 
     623     */ 
     624    function test_set_role_same_role() { 
     625        $user = new WP_User( $this->factory->user->create( array( 'role' => 'administrator' ) ) ); 
     626        $caps = $user->caps; 
     627        $this->assertNotEmpty( $user->caps ); 
     628        $user->set_role( 'administrator' ); 
     629        $this->assertNotEmpty( $user->caps ); 
     630        $this->assertEquals( $caps, $user->caps ); 
     631    } 
    620632} 
Note: See TracChangeset for help on using the changeset viewer.