Changeset 60253 for trunk/tests/phpunit/tests/customize/panel.php
- Timestamp:
- 05/26/2025 02:34:12 PM (12 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/customize/panel.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/panel.php
r56547 r60253 7 7 */ 8 8 class Tests_WP_Customize_Panel extends WP_UnitTestCase { 9 10 /** 11 * ID of the administrator user. 12 * 13 * @var int 14 */ 15 public static $administrator_id; 16 17 /** 18 * Set up the shared fixture. 19 * 20 * @param WP_UnitTest_Factory $factory Factory instance. 21 */ 22 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 23 self::$administrator_id = $factory->user->create( array( 'role' => 'administrator' ) ); 24 } 9 25 10 26 /** … … 132 148 */ 133 149 public function test_check_capabilities() { 134 $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); 135 wp_set_current_user( $user_id ); 150 wp_set_current_user( self::$administrator_id ); 136 151 137 152 $panel = new WP_Customize_Panel( $this->manager, 'foo' ); … … 158 173 */ 159 174 public function test_maybe_render() { 160 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'administrator' ) ));175 wp_set_current_user( self::$administrator_id ); 161 176 $panel = new WP_Customize_Panel( $this->manager, 'bar' ); 162 177 $customize_render_panel_count = did_action( 'customize_render_panel' ); … … 183 198 */ 184 199 public function test_print_templates_standard() { 185 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'administrator' ) ));200 wp_set_current_user( self::$administrator_id ); 186 201 187 202 $panel = new WP_Customize_Panel( $this->manager, 'baz' ); … … 201 216 */ 202 217 public function test_print_templates_custom() { 203 wp_set_current_user( self:: factory()->user->create( array( 'role' => 'administrator' ) ));218 wp_set_current_user( self::$administrator_id ); 204 219 205 220 $panel = new Custom_Panel_Test( $this->manager, 'baz' );
Note: See TracChangeset
for help on using the changeset viewer.