Make WordPress Core

Changeset 39555


Ignore:
Timestamp:
12/09/2016 11:35:55 PM (8 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Reuse another fixture in the user capability tests.

See #38716

File:
1 edited

Legend:

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

    r39494 r39555  
    13871387     */
    13881388    function test_current_user_edit_caps() {
    1389         $user = new WP_User( self::factory()->user->create( array( 'role' => 'contributor' ) ) );
     1389        $user = self::$users['contributor'];
    13901390        wp_set_current_user( $user->ID );
    13911391
    13921392        $user->add_cap( 'publish_posts' );
     1393        $this->assertTrue( $user->has_cap( 'publish_posts' ) );
     1394
    13931395        $user->add_cap( 'publish_pages' );
    1394         $this->assertTrue( $user->has_cap( 'publish_posts' ) );
    13951396        $this->assertTrue( $user->has_cap( 'publish_pages' ) );
    13961397
    13971398        $user->remove_cap( 'publish_pages' );
    13981399        $this->assertFalse( $user->has_cap( 'publish_pages' ) );
     1400
     1401        $user->remove_cap( 'publish_posts' );
     1402        $this->assertFalse( $user->has_cap( 'publish_posts' ) );
    13991403    }
    14001404
Note: See TracChangeset for help on using the changeset viewer.