Changeset 31190 for trunk/tests/phpunit/tests/user/capabilities.php
- Timestamp:
- 01/16/2015 01:48:36 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/capabilities.php
r27390 r31190 695 695 wp_set_current_user( $old_uid ); 696 696 } 697 698 /** 699 * @ticket 28374 700 */ 701 function test_current_user_edit_caps() { 702 $user = new WP_User( $this->factory->user->create( array( 'role' => 'contributor' ) ) ); 703 wp_set_current_user( $user->ID ); 704 705 $user->add_cap( 'publish_posts' ); 706 $user->add_cap( 'publish_pages' ); 707 $this->assertTrue( $user->has_cap( 'publish_posts' ) ); 708 $this->assertTrue( $user->has_cap( 'publish_pages' ) ); 709 710 $user->remove_cap( 'publish_pages' ); 711 $this->assertFalse( $user->has_cap( 'publish_pages' ) ); 712 } 697 713 }
Note: See TracChangeset
for help on using the changeset viewer.