Changeset 7041
- Timestamp:
- 05/09/2013 01:20:02 PM (13 years ago)
- Location:
- trunk/tests
- Files:
-
- 2 edited
-
includes/testcase.php (modified) (1 diff)
-
testcases/members/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/includes/testcase.php
r7040 r7041 165 165 return $user_id; 166 166 } 167 168 /** 169 * We can't use grant_super_admin() because we will need to modify 170 * the list more than once, and grant_super_admin() can only be run 171 * once because of its global check 172 */ 173 public function grant_super_admin( $user_id ) { 174 global $super_admins; 175 if ( ! is_multisite() ) { 176 return; 177 } 178 179 $user = get_userdata( $user_id ); 180 $super_admins[] = $user->user_login; 181 } 182 183 public function restore_admins() { 184 // We assume that the global can be wiped out 185 // @see grant_super_admin() 186 unset( $GLOBALS['super_admins'] ); 187 } 188 189 167 190 } -
trunk/tests/testcases/members/functions.php
r7034 r7041 16 16 parent::tearDown(); 17 17 $this->set_current_user( $this->old_current_user ); 18 }19 20 /**21 * We can't use grant_super_admin() because we will need to modify22 * the list more than once, and grant_super_admin() can only be run23 * once because of its global check24 */25 public function grant_super_admin( $user_id ) {26 global $super_admins;27 if ( ! is_multisite() ) {28 return;29 }30 31 $user = get_userdata( $user_id );32 $super_admins[] = $user->user_login;33 }34 35 public function restore_admins() {36 // We assume that the global can be wiped out37 // @see grant_super_admin()38 unset( $GLOBALS['super_admins'] );39 18 } 40 19
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)