Skip to content

Commit 2fcad86

Browse files
committed
Tests: Isolate stylesheet assertions in embed and Customizer tests.
Reset `$wp_styles` after the embed tests so later tests can print emoji styles. Check the `customize-preview` stylesheet in the Customizer manager test that enqueues it. Developed in: #16147, #16148 Props ekamran. See #66755. git-svn-id: https://develop.svn.wordpress.org/trunk@65737 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 78d8b11 commit 2fcad86

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎tests/phpunit/tests/customize/manager.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ public function test_customize_preview_init() {
925925
$this->assertSame( 10, has_filter( 'wp_headers', array( $wp_customize, 'filter_iframe_security_headers' ) ) );
926926
$this->assertSame( 10, has_filter( 'wp_redirect', array( $wp_customize, 'add_state_query_params' ) ) );
927927
$this->assertTrue( wp_script_is( 'customize-preview', 'enqueued' ) );
928+
$this->assertTrue( wp_style_is( 'customize-preview', 'enqueued' ) );
928929
$this->assertSame( 10, has_action( 'wp_head', array( $wp_customize, 'customize_preview_loading_style' ) ) );
929930
$this->assertSame( 20, has_action( 'wp_footer', array( $wp_customize, 'customize_preview_settings' ) ) );
930931

‎tests/phpunit/tests/customize/widgets.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,6 @@ public function test_selective_refresh_init_without_theme_support() {
782782
public function test_customize_preview_enqueue() {
783783
$this->manager->widgets->customize_preview_enqueue();
784784
$this->assertTrue( wp_script_is( 'customize-preview-widgets', 'enqueued' ) );
785-
$this->assertTrue( wp_style_is( 'customize-preview', 'enqueued' ) );
786785
$script = wp_scripts()->registered['customize-preview-widgets'];
787786
$this->assertContains( 'customize-selective-refresh', $script->deps );
788787
}

‎tests/phpunit/tests/oembed/template.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ public function set_up() {
2323
public function tear_down() {
2424
parent::tear_down();
2525

26-
global $wp_scripts;
26+
global $wp_scripts, $wp_styles;
2727
$wp_scripts = null;
28+
$wp_styles = null;
2829
}
2930

3031
/**

0 commit comments

Comments
 (0)