Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 52694b6

Browse files
committed
Ensure setup_theme is triggered in test so that WP_Customize_Manager::$original_stylesheet will be set
1 parent eb003e3 commit 52694b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/php/test-class-customize-snapshot-manager.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,13 @@ public function test_is_theme_active() {
387387
public function test_add_snapshot_uuid_to_return_url() {
388388
global $wp_version;
389389
if ( version_compare( $wp_version, '4.4-beta', '>=' ) ) {
390-
$_GET[ $this->front_param ] = $_REQUEST[ $this->front_param ] = self::UUID;
390+
wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
391+
$_GET[ $this->front_param ] = self::UUID;
392+
$_REQUEST[ $this->front_param ] = self::UUID;
391393
$manager = $this->get_snapshot_manager_instance( $this->plugin );
392394
$manager->init();
393395
$manager->ensure_customize_manager();
396+
do_action( 'setup_theme' );
394397
$this->assertNotContains( $this->front_param, $manager->customize_manager->get_return_url() );
395398
$manager->add_snapshot_uuid_to_return_url();
396399
$this->assertContains( $this->front_param, $manager->customize_manager->get_return_url() );

0 commit comments

Comments
 (0)