Changeset 39008
- Timestamp:
- 10/30/2016 12:32:03 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/capabilities.php
r38938 r39008 1383 1383 } 1384 1384 1385 $user = new WP_User( self::factory()->user->create( array( 'role' => 'administrator' ) ) );1385 $user = self::$users['administrator']; 1386 1386 $user->add_cap( 'manage_network_users' ); 1387 1387 $other_user = self::$users['subscriber']; … … 1389 1389 wp_set_current_user( $user->ID ); 1390 1390 1391 $this->assertTrue( current_user_can( 'edit_user', $other_user->ID ) ); 1391 $can_edit_user = current_user_can( 'edit_user', $other_user->ID ); 1392 1393 $user->remove_cap( 'manage_network_users' ); 1394 1395 $this->assertTrue( $can_edit_user ); 1392 1396 } 1393 1397 … … 1398 1402 } 1399 1403 1400 $user = new WP_User( self::factory()->user->create( array( 'role' => 'administrator' ) ) );1404 $user = self::$users['administrator']; 1401 1405 $user->add_cap( 'manage_network_users' ); 1402 $super_admin = new WP_User( self::factory()->user->create( array( 'role' => 'subscriber' ) ) );1406 $super_admin = self::$users['subscriber']; 1403 1407 grant_super_admin( $super_admin->ID ); 1404 1408 1405 1409 wp_set_current_user( $user->ID ); 1406 1410 1407 $this->assertFalse( current_user_can( 'edit_user', $super_admin->ID ) ); 1411 $can_edit_user = current_user_can( 'edit_user', $super_admin->ID ); 1412 1413 $user->remove_cap( 'manage_network_users' ); 1414 revoke_super_admin( $super_admin->ID ); 1415 1416 $this->assertFalse( $can_edit_user ); 1408 1417 } 1409 1418
Note: See TracChangeset
for help on using the changeset viewer.