Changeset 60364 for trunk/tests/phpunit/tests/user/capabilities.php
- Timestamp:
- 06/29/2025 09:45:30 PM (11 months 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
r59198 r60364 994 994 995 995 /** 996 * Test add_role with implied capabilities grant successfully grants capabilities. 997 * 998 * @ticket 43421 999 */ 1000 public function test_add_role_with_single_level_capabilities() { 1001 $role_name = 'janitor'; 1002 add_role( 1003 $role_name, 1004 'Janitor', 1005 array( 1006 'foo', 1007 ) 1008 ); 1009 $this->flush_roles(); 1010 1011 // Assign a user to that role. 1012 $id = self::factory()->user->create( array( 'role' => $role_name ) ); 1013 $user = new WP_User( $id ); 1014 1015 $this->assertTrue( $user->has_cap( 'foo' ) ); 1016 } 1017 1018 /** 996 1019 * Change the capabilities associated with a role and make sure the change 997 1020 * is reflected in has_cap().
Note: See TracChangeset
for help on using the changeset viewer.