Changeset 49604
- Timestamp:
- 11/15/2020 02:17:31 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/capabilities.php
r49603 r49604 9 9 class Tests_User_Capabilities extends WP_UnitTestCase { 10 10 11 protected static $users = array( 11 /** 12 * @var WP_User[] $users 13 */ 14 protected static $users = array( 12 15 'administrator' => null, 13 16 'editor' => null, … … 16 19 'subscriber' => null, 17 20 ); 21 22 /** 23 * @var WP_User $super_admin 24 */ 18 25 protected static $super_admin = null; 19 26 27 /** 28 * @var int $block_id 29 */ 20 30 protected static $block_id; 21 31 … … 533 543 } 534 544 } 535 } 536 537 $this->assertFalse( $user->has_cap('start_a_fire' ), "User with the {$role} role should not have a custom capability" );538 $this->assertFalse( user_can( $user, 'start_a_fire' ), "User with the {$role} role should not have a custom capability" ); 539 540 $this->assertFalse( $user->has_cap('do_not_allow' ), "User with the {$role} role should not have the do_not_allow capability" );541 $this->assertFalse( user_can( $user, 'do_not_allow' ), "User with the {$role} role should not have the do_not_allow capability" ); 542 543 $this->assertTrue( $user->has_cap('exist' ), "User with the {$role} role should have the exist capability" );544 $this->assertTrue( user_can( $user, 'exist' ), "User with the {$role} role should have the exist capability" );545 546 $this->assertFalse( $user->has_cap( 'start_a_fire' ), "User with the {$role} role should not have a custom capability" ); 547 $this->assertFalse( user_can( $user, 'start_a_fire' ), "User with the {$role} role should not have a custom capability" ); 548 549 $this->assertFalse( $user->has_cap( 'do_not_allow' ), "User with the {$role} role should not have the do_not_allow capability" ); 550 $this->assertFalse( user_can( $user, 'do_not_allow' ), "User with the {$role} role should not have the do_not_allow capability" ); 551 552 $this->assertTrue( $user->has_cap( 'exist' ), "User with the {$role} role should have the exist capability" ); 553 $this->assertTrue( user_can( $user, 'exist' ), "User with the {$role} role should have the exist capability" ); 554 } 545 555 } 546 556
Note: See TracChangeset
for help on using the changeset viewer.