Changeset 39555
- Timestamp:
- 12/09/2016 11:35:55 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/capabilities.php
r39494 r39555 1387 1387 */ 1388 1388 function test_current_user_edit_caps() { 1389 $user = new WP_User( self::factory()->user->create( array( 'role' => 'contributor' ) ) );1389 $user = self::$users['contributor']; 1390 1390 wp_set_current_user( $user->ID ); 1391 1391 1392 1392 $user->add_cap( 'publish_posts' ); 1393 $this->assertTrue( $user->has_cap( 'publish_posts' ) ); 1394 1393 1395 $user->add_cap( 'publish_pages' ); 1394 $this->assertTrue( $user->has_cap( 'publish_posts' ) );1395 1396 $this->assertTrue( $user->has_cap( 'publish_pages' ) ); 1396 1397 1397 1398 $user->remove_cap( 'publish_pages' ); 1398 1399 $this->assertFalse( $user->has_cap( 'publish_pages' ) ); 1400 1401 $user->remove_cap( 'publish_posts' ); 1402 $this->assertFalse( $user->has_cap( 'publish_posts' ) ); 1399 1403 } 1400 1404
Note: See TracChangeset
for help on using the changeset viewer.