Changeset 52823 for trunk/tests/phpunit/tests/user/capabilities.php
- Timestamp:
- 03/06/2022 04:09:06 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/user/capabilities.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/capabilities.php
r52010 r52823 1624 1624 $caps = $user->caps; 1625 1625 $this->assertNotEmpty( $user->caps ); 1626 1626 1627 $user->set_role( 'administrator' ); 1627 1628 $this->assertNotEmpty( $user->caps ); 1628 1629 $this->assertSame( $caps, $user->caps ); 1630 } 1631 1632 /** 1633 * @ticket 54164 1634 */ 1635 public function test_set_role_fires_remove_user_role_and_add_user_role_hooks() { 1636 $user = self::$users['administrator']; 1637 1638 $remove_user_role = new MockAction(); 1639 $add_user_role = new MockAction(); 1640 add_action( 'remove_user_role', array( $remove_user_role, 'action' ) ); 1641 add_action( 'add_user_role', array( $add_user_role, 'action' ) ); 1642 1643 $user->set_role( 'editor' ); 1644 $this->assertSame( 1, $remove_user_role->get_call_count() ); 1645 $this->assertSame( 1, $add_user_role->get_call_count() ); 1629 1646 } 1630 1647
Note: See TracChangeset
for help on using the changeset viewer.