- Timestamp:
- 05/26/2025 02:34:12 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/custom-css-setting.php
r54865 r60253 24 24 25 25 /** 26 * The user ID to use for the tests. 27 * 28 * @var int 29 */ 30 public static $user_id = 0; 31 32 /** 33 * Set up the test case. 34 * 35 * @see WP_UnitTestCase::set_up() 36 */ 37 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 38 // Create a user to use for the tests. 39 self::$user_id = $factory->user->create( 40 array( 41 'role' => 'administrator', 42 ) 43 ); 44 45 if ( is_multisite() ) { 46 grant_super_admin( self::$user_id ); 47 } 48 } 49 50 /** 26 51 * Set up the test case. 27 52 * … … 32 57 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; 33 58 34 $user_id = self::factory()->user->create( 35 array( 36 'role' => 'administrator', 37 ) 38 ); 39 if ( is_multisite() ) { 40 grant_super_admin( $user_id ); 41 } 42 43 wp_set_current_user( $user_id ); 59 wp_set_current_user( self::$user_id ); 44 60 45 61 global $wp_customize;
Note: See TracChangeset
for help on using the changeset viewer.