Changeset 49932 for trunk/tests/phpunit/tests/user/capabilities.php
- Timestamp:
- 01/04/2021 11:32:49 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/capabilities.php
r49605 r49932 1005 1005 function test_user_add_cap() { 1006 1006 // There are two contributors. 1007 $id_1 = self:: factory()->user->create( array( 'role' => 'contributor' ) );1007 $id_1 = self::$users['contributor']->ID; 1008 1008 $id_2 = self::factory()->user->create( array( 'role' => 'contributor' ) ); 1009 1009 … … 1044 1044 function test_user_remove_cap() { 1045 1045 // There are two contributors. 1046 $id_1 = self:: factory()->user->create( array( 'role' => 'contributor' ) );1046 $id_1 = self::$users['contributor']->ID; 1047 1047 $id_2 = self::factory()->user->create( array( 'role' => 'contributor' ) ); 1048 1048 … … 1076 1076 function test_user_level_update() { 1077 1077 // User starts as an author. 1078 $id = self:: factory()->user->create( array( 'role' => 'author' ) );1078 $id = self::$users['author']->ID; 1079 1079 $user = new WP_User( $id ); 1080 1080 $this->assertTrue( $user->exists(), "Problem getting user $id" ); … … 1099 1099 function test_user_remove_all_caps() { 1100 1100 // User starts as an author. 1101 $id = self:: factory()->user->create( array( 'role' => 'author' ) );1101 $id = self::$users['author']->ID; 1102 1102 $user = new WP_User( $id ); 1103 1103 $this->assertTrue( $user->exists(), "Problem getting user $id" ); … … 1154 1154 1155 1155 // Add some other users. 1156 $admin = new WP_User( self::factory()->user->create( array( 'role' => 'administrator' ) ) );1156 $admin = self::$users['administrator']; 1157 1157 $author_2 = new WP_User( self::factory()->user->create( array( 'role' => 'author' ) ) ); 1158 $editor = new WP_User( self::factory()->user->create( array( 'role' => 'editor' ) ) );1159 $contributor = new WP_User( self::factory()->user->create( array( 'role' => 'contributor' ) ) );1158 $editor = self::$users['editor']; 1159 $contributor = self::$users['contributor']; 1160 1160 1161 1161 // Administrators, editors and the post owner can edit it. … … 1901 1901 */ 1902 1902 function test_wp_logout_should_clear_current_user() { 1903 $user_id = self:: factory()->user->create();1903 $user_id = self::$users['author']->ID; 1904 1904 wp_set_current_user( $user_id ); 1905 1905
Note: See TracChangeset
for help on using the changeset viewer.