Changeset 50491 for trunk/tests/phpunit/tests/user/capabilities.php
- Timestamp:
- 03/04/2021 10:11:38 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/capabilities.php
r50490 r50491 646 646 foreach ( self::$users as $role => $user ) { 647 647 648 # Test adding the cap directly to the user648 // Test adding the cap directly to the user. 649 649 $user->add_cap( 'do_not_allow' ); 650 650 $has_cap = $user->has_cap( 'do_not_allow' ); … … 652 652 $this->assertFalse( $has_cap, "User with the {$role} role should not have the do_not_allow capability" ); 653 653 654 # Test adding the cap via a filter654 // Test adding the cap via a filter. 655 655 add_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 ); 656 656 $has_cap = $user->has_cap( 'do_not_allow' ); … … 663 663 } 664 664 665 # Test adding the cap to the user's role665 // Test adding the cap to the user's role. 666 666 $role_obj = get_role( $role ); 667 667 $role_obj->add_cap( 'do_not_allow' ); … … 677 677 */ 678 678 public function test_do_not_allow_is_denied_for_super_admins() { 679 # Test adding the cap directly to the user679 // Test adding the cap directly to the user. 680 680 self::$super_admin->add_cap( 'do_not_allow' ); 681 681 $has_cap = self::$super_admin->has_cap( 'do_not_allow' ); … … 683 683 $this->assertFalse( $has_cap, 'Super admins should not have the do_not_allow capability' ); 684 684 685 # Test adding the cap via a filter685 // Test adding the cap via a filter. 686 686 add_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 ); 687 687 $has_cap = self::$super_admin->has_cap( 'do_not_allow' );
Note: See TracChangeset
for help on using the changeset viewer.