Changeset 60253 for trunk/tests/phpunit/tests/customize/widgets.php
- Timestamp:
- 05/26/2025 02:34:12 PM (8 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/customize/widgets.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/widgets.php
r56746 r60253 21 21 protected $backup_registered_sidebars; 22 22 23 /** 24 * ID of the administrator user. 25 * 26 * @var int 27 */ 28 public static $administrator_id; 29 30 /** 31 * Set up the shared fixture. 32 * 33 * @param WP_UnitTest_Factory $factory Factory instance. 34 */ 35 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 36 self::$administrator_id = $factory->user->create( array( 'role' => 'administrator' ) ); 37 } 38 23 39 public function set_up() { 24 40 parent::set_up(); … … 28 44 add_action( 'widgets_init', array( $this, 'remove_widgets_block_editor' ) ); 29 45 30 $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); 31 wp_set_current_user( $user_id ); 46 wp_set_current_user( self::$administrator_id ); 32 47 33 48 update_option(
Note: See TracChangeset
for help on using the changeset viewer.