Changeset 60253 for trunk/tests/phpunit/tests/customize/control.php
- Timestamp:
- 05/26/2025 02:34:12 PM (8 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/customize/control.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/control.php
r55457 r60253 19 19 20 20 /** 21 * Shared user ID for the tests. 22 23 * @var int 24 */ 25 public static $user_id = 0; 26 27 /** 28 * Set up shared fixtures. 29 * 30 * @param WP_UnitTest_Factory $factory Factory. 31 */ 32 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 33 self::$user_id = $factory->user->create( array( 'role' => 'administrator' ) ); 34 } 35 36 /** 21 37 * Set up. 22 38 */ 23 39 public function set_up() { 24 40 parent::set_up(); 25 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'administrator' ) ));41 wp_set_current_user( self::$user_id ); 26 42 require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; 27 43 $GLOBALS['wp_customize'] = new WP_Customize_Manager();
Note: See TracChangeset
for help on using the changeset viewer.