Changeset 35236 for trunk/tests/phpunit/tests/customize/widgets.php
- Timestamp:
- 10/17/2015 04:43:27 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/widgets.php
r35225 r35236 12 12 */ 13 13 protected $manager; 14 15 /** 16 * Stored global variable in setUp for restoration in tearDown. 17 * 18 * @see $wp_registered_sidebars 19 * @var array 20 */ 21 protected $backup_registered_sidebars; 14 22 15 23 function setUp() { … … 33 41 $user_id = self::$factory->user->create( array( 'role' => 'administrator' ) ); 34 42 wp_set_current_user( $user_id ); 43 44 $this->backup_registered_sidebars = $GLOBALS['wp_registered_sidebars']; 35 45 } 36 46 … … 39 49 unset( $GLOBALS['wp_customize'] ); 40 50 unset( $GLOBALS['wp_scripts'] ); 51 $GLOBALS['wp_registered_sidebars'] = $this->backup_registered_sidebars; 41 52 parent::tearDown(); 42 53 } … … 264 275 $this->assertArrayHasKey( 'height', $params ); 265 276 $this->assertInternalType( 'bool', $params['is_wide'] ); 266 277 } 278 279 /** 280 * @see WP_Customize_Widgets::is_panel_active() 281 */ 282 function test_is_panel_active() { 283 global $wp_registered_sidebars; 284 $this->do_customize_boot_actions(); 285 286 $this->assertNotEmpty( $wp_registered_sidebars ); 287 $this->assertTrue( $this->manager->widgets->is_panel_active() ); 288 $this->assertTrue( $this->manager->get_panel( 'widgets' )->active() ); 289 290 $wp_registered_sidebars = array(); 291 $this->assertFalse( $this->manager->widgets->is_panel_active() ); 292 $this->assertFalse( $this->manager->get_panel( 'widgets' )->active() ); 267 293 } 268 294 }
Note: See TracChangeset
for help on using the changeset viewer.