From 079c7d8a21ab2b56a2fc2a855a8341e4c8985a6d Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Tue, 31 Oct 2023 16:56:54 +0000 Subject: [PATCH 1/4] WP-r55888: Script Loader: Improve performance of wp_maybe_inline_styles function. The `wp_maybe_inline_styles` function is called twice on the average page load. On it's second run however, it did not check to see if the style had already been processed on the first run. This resulted in calling `filesize` and `get_file_contents` unnecessarily, which was bad for performance. Now, the loop around the queued styles, checks to see if the source is set to false, meaning it has already been processed. This change also replaces calls to `filesize` with the core function `wp_filesize`, which improves extensibility. WP:Props spacedmonkey, flixos90, peterwilsoncc, joemcgill. Fixes https://core.trac.wordpress.org/ticket/58394. Conflicts: - tests/phpunit/tests/dependencies/styles.php --- Merges https://core.trac.wordpress.org/changeset/55888 / WordPress/wordpress-develop@582ddb82f4 to ClassicPress. --- src/wp-includes/script-loader.php | 14 +- tests/phpunit/tests/dependencies/styles.php | 203 ++++++++++++++++++++ 2 files changed, 213 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index c82aa01eed..20803ce7e0 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -2128,12 +2128,18 @@ function wp_maybe_inline_styles() { // Build an array of styles that have a path defined. foreach ( $wp_styles->queue as $handle ) { - if ( wp_styles()->get_data( $handle, 'path' ) && file_exists( $wp_styles->registered[ $handle ]->extra['path'] ) ) { + $src = $wp_styles->registered[ $handle ]->src; + $path = wp_styles()->get_data( $handle, 'path' ); + if ( $path && $src ) { + $size = wp_filesize( $path ); + if ( ! $size ) { + continue; + } $styles[] = array( 'handle' => $handle, - 'src' => $wp_styles->registered[ $handle ]->src, - 'path' => $wp_styles->registered[ $handle ]->extra['path'], - 'size' => filesize( $wp_styles->registered[ $handle ]->extra['path'] ), + 'src' => $src, + 'path' => $path, + 'size' => $size, ); } } diff --git a/tests/phpunit/tests/dependencies/styles.php b/tests/phpunit/tests/dependencies/styles.php index d86fcff061..6251c16660 100644 --- a/tests/phpunit/tests/dependencies/styles.php +++ b/tests/phpunit/tests/dependencies/styles.php @@ -519,4 +519,207 @@ public function data_styles_with_media() { ), ); } +<<<<<<< HEAD +======= + + /** + * Tests that visual block styles are not be enqueued in the editor when there is not theme support for 'wp-block-styles'. + * + * @ticket 57561 + * + * @covers ::wp_enqueue_style + */ + public function test_block_styles_for_editing_without_theme_support() { + // Confirm we are without theme support by default. + $this->assertFalse( current_theme_supports( 'wp-block-styles' ) ); + + wp_default_styles( $GLOBALS['wp_styles'] ); + + $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); + wp_enqueue_style( 'wp-edit-blocks' ); + $this->assertFalse( wp_style_is( 'wp-block-library-theme' ), "The 'wp-block-library-theme' style should not be in the queue after enqueuing 'wp-edit-blocks'" ); + } + + /** + * Tests that visual block styles are enqueued when there is theme support for 'wp-block-styles'. + * + * Visual block styles should always be enqueued when editing to avoid the appearance of a broken editor. + * + * @covers ::wp_common_block_scripts_and_styles + */ + public function test_block_styles_for_editing_with_theme_support() { + add_theme_support( 'wp-block-styles' ); + + wp_default_styles( $GLOBALS['wp_styles'] ); + + $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); + wp_common_block_scripts_and_styles(); + $this->assertTrue( wp_style_is( 'wp-block-library-theme' ) ); + } + + /** + * Tests that visual block styles are not enqueued for viewing when there is no theme support for 'wp-block-styles'. + * + * Visual block styles should not be enqueued unless a theme opts in. + * This way we avoid style conflicts with existing themes. + * + * @covers ::wp_enqueue_style + */ + public function test_no_block_styles_for_viewing_without_theme_support() { + // Confirm we are without theme support by default. + $this->assertFalse( current_theme_supports( 'wp-block-styles' ) ); + + wp_default_styles( $GLOBALS['wp_styles'] ); + + $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); + wp_enqueue_style( 'wp-block-library' ); + $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); + } + + /** + * Tests that visual block styles are enqueued for viewing when there is theme support for 'wp-block-styles'. + * + * Visual block styles should be enqueued when a theme opts in. + * + * @covers ::wp_common_block_scripts_and_styles + */ + public function test_block_styles_for_viewing_with_theme_support() { + add_theme_support( 'wp-block-styles' ); + + wp_default_styles( $GLOBALS['wp_styles'] ); + + $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); + wp_common_block_scripts_and_styles(); + $this->assertTrue( wp_style_is( 'wp-block-library-theme' ) ); + } + + /** + * Tests that the main "style.css" file gets enqueued when the site doesn't opt in to separate core block assets. + * + * @ticket 50263 + * + * @covers ::wp_default_styles + */ + public function test_block_styles_for_viewing_without_split_styles() { + add_filter( 'should_load_separate_core_block_assets', '__return_false' ); + wp_default_styles( $GLOBALS['wp_styles'] ); + + $this->assertSame( + '/' . WPINC . '/css/dist/block-library/style.css', + $GLOBALS['wp_styles']->registered['wp-block-library']->src + ); + } + + /** + * Tests that the "common.css" file gets enqueued when the site opts in to separate core block assets. + * + * @ticket 50263 + * + * @covers ::wp_default_styles + */ + public function test_block_styles_for_viewing_with_split_styles() { + add_filter( 'should_load_separate_core_block_assets', '__return_true' ); + wp_default_styles( $GLOBALS['wp_styles'] ); + + $this->assertSame( + '/' . WPINC . '/css/dist/block-library/common.css', + $GLOBALS['wp_styles']->registered['wp-block-library']->src + ); + } + + /** + * @ticket 58394 + * + * @covers ::wp_maybe_inline_styles + */ + public function test_wp_maybe_inline_styles() { + wp_register_style( 'test-handle', '/' . WPINC . '/css/classic-themes.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/classic-themes.css' ); + + wp_enqueue_style( 'test-handle' ); + + wp_maybe_inline_styles(); + + $this->assertFalse( $GLOBALS['wp_styles']->registered['test-handle']->src, 'Source of style should be reset to false' ); + + $css = file_get_contents( ABSPATH . WPINC . '/css/classic-themes.css' ); + $this->assertSameSets( $GLOBALS['wp_styles']->registered['test-handle']->extra['after'], array( $css ), 'Source of style should set to after property' ); + } + + /** + * wp_filesize should be only be called once, as on the second run of wp_maybe_inline_styles, + * src will be set to false and filesize will not be requested. + * + * @ticket 58394 + * + * @covers ::wp_maybe_inline_styles + */ + public function test_wp_maybe_inline_styles_multiple_runs() { + $filter = new MockAction(); + add_filter( 'pre_wp_filesize', array( $filter, 'filter' ) ); + wp_register_style( 'test-handle', '/' . WPINC . '/css/classic-themes.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/classic-themes.css' ); + + wp_enqueue_style( 'test-handle' ); + + wp_maybe_inline_styles(); + wp_maybe_inline_styles(); + + $this->assertSame( 1, $filter->get_call_count() ); + } + + /** + * @ticket 58394 + * + * @covers ::wp_maybe_inline_styles + */ + public function test_test_wp_maybe_inline_styles_missing_file() { + $filter = new MockAction(); + add_filter( 'pre_wp_filesize', array( $filter, 'filter' ) ); + $url = '/' . WPINC . '/css/invalid.css'; + wp_register_style( 'test-handle', $url ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/invalid.css' ); + + wp_enqueue_style( 'test-handle' ); + + wp_maybe_inline_styles(); + + $this->assertSame( $GLOBALS['wp_styles']->registered['test-handle']->src, $url, 'Source should not change' ); + $this->assertArrayNotHasKey( 'after', $GLOBALS['wp_styles']->registered['test-handle']->extra, 'Source of style not should set to after property' ); + $this->assertSame( 1, $filter->get_call_count(), 'wp_filesize should only be called once' ); + } + + /** + * @ticket 58394 + * + * @covers ::wp_maybe_inline_styles + */ + public function test_wp_maybe_inline_styles_no_src() { + wp_register_style( 'test-handle', false ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/classic-themes.css' ); + + wp_enqueue_style( 'test-handle' ); + + wp_maybe_inline_styles(); + + $this->assertFalse( $GLOBALS['wp_styles']->registered['test-handle']->src, 'Source of style should remain false' ); + $this->assertArrayNotHasKey( 'after', $GLOBALS['wp_styles']->registered['test-handle']->extra, 'Source of style not should set to after property' ); + } + + /** + * @ticket 58394 + * + * @covers ::wp_maybe_inline_styles + */ + public function test_wp_maybe_inline_styles_no_path() { + $url = '/' . WPINC . '/css/classic-themes.css'; + wp_register_style( 'test-handle', $url ); + + wp_enqueue_style( 'test-handle' ); + + wp_maybe_inline_styles(); + + $this->assertSame( $GLOBALS['wp_styles']->registered['test-handle']->src, $url ); + } +>>>>>>> 582ddb82f4 (Script Loader: Improve performance of wp_maybe_inline_styles function. ) } From f8a568d69c7fb7557f9b4ff6861b7eae5c869d51 Mon Sep 17 00:00:00 2001 From: mattyrob Date: Tue, 31 Oct 2023 17:05:15 +0000 Subject: [PATCH 2/4] Fix merge conflicts and use css file from repo --- tests/phpunit/tests/dependencies/styles.php | 122 ++------------------ 1 file changed, 7 insertions(+), 115 deletions(-) diff --git a/tests/phpunit/tests/dependencies/styles.php b/tests/phpunit/tests/dependencies/styles.php index 6251c16660..9a45d409fa 100644 --- a/tests/phpunit/tests/dependencies/styles.php +++ b/tests/phpunit/tests/dependencies/styles.php @@ -519,113 +519,6 @@ public function data_styles_with_media() { ), ); } -<<<<<<< HEAD -======= - - /** - * Tests that visual block styles are not be enqueued in the editor when there is not theme support for 'wp-block-styles'. - * - * @ticket 57561 - * - * @covers ::wp_enqueue_style - */ - public function test_block_styles_for_editing_without_theme_support() { - // Confirm we are without theme support by default. - $this->assertFalse( current_theme_supports( 'wp-block-styles' ) ); - - wp_default_styles( $GLOBALS['wp_styles'] ); - - $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); - wp_enqueue_style( 'wp-edit-blocks' ); - $this->assertFalse( wp_style_is( 'wp-block-library-theme' ), "The 'wp-block-library-theme' style should not be in the queue after enqueuing 'wp-edit-blocks'" ); - } - - /** - * Tests that visual block styles are enqueued when there is theme support for 'wp-block-styles'. - * - * Visual block styles should always be enqueued when editing to avoid the appearance of a broken editor. - * - * @covers ::wp_common_block_scripts_and_styles - */ - public function test_block_styles_for_editing_with_theme_support() { - add_theme_support( 'wp-block-styles' ); - - wp_default_styles( $GLOBALS['wp_styles'] ); - - $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); - wp_common_block_scripts_and_styles(); - $this->assertTrue( wp_style_is( 'wp-block-library-theme' ) ); - } - - /** - * Tests that visual block styles are not enqueued for viewing when there is no theme support for 'wp-block-styles'. - * - * Visual block styles should not be enqueued unless a theme opts in. - * This way we avoid style conflicts with existing themes. - * - * @covers ::wp_enqueue_style - */ - public function test_no_block_styles_for_viewing_without_theme_support() { - // Confirm we are without theme support by default. - $this->assertFalse( current_theme_supports( 'wp-block-styles' ) ); - - wp_default_styles( $GLOBALS['wp_styles'] ); - - $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); - wp_enqueue_style( 'wp-block-library' ); - $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); - } - - /** - * Tests that visual block styles are enqueued for viewing when there is theme support for 'wp-block-styles'. - * - * Visual block styles should be enqueued when a theme opts in. - * - * @covers ::wp_common_block_scripts_and_styles - */ - public function test_block_styles_for_viewing_with_theme_support() { - add_theme_support( 'wp-block-styles' ); - - wp_default_styles( $GLOBALS['wp_styles'] ); - - $this->assertFalse( wp_style_is( 'wp-block-library-theme' ) ); - wp_common_block_scripts_and_styles(); - $this->assertTrue( wp_style_is( 'wp-block-library-theme' ) ); - } - - /** - * Tests that the main "style.css" file gets enqueued when the site doesn't opt in to separate core block assets. - * - * @ticket 50263 - * - * @covers ::wp_default_styles - */ - public function test_block_styles_for_viewing_without_split_styles() { - add_filter( 'should_load_separate_core_block_assets', '__return_false' ); - wp_default_styles( $GLOBALS['wp_styles'] ); - - $this->assertSame( - '/' . WPINC . '/css/dist/block-library/style.css', - $GLOBALS['wp_styles']->registered['wp-block-library']->src - ); - } - - /** - * Tests that the "common.css" file gets enqueued when the site opts in to separate core block assets. - * - * @ticket 50263 - * - * @covers ::wp_default_styles - */ - public function test_block_styles_for_viewing_with_split_styles() { - add_filter( 'should_load_separate_core_block_assets', '__return_true' ); - wp_default_styles( $GLOBALS['wp_styles'] ); - - $this->assertSame( - '/' . WPINC . '/css/dist/block-library/common.css', - $GLOBALS['wp_styles']->registered['wp-block-library']->src - ); - } /** * @ticket 58394 @@ -633,8 +526,8 @@ public function test_block_styles_for_viewing_with_split_styles() { * @covers ::wp_maybe_inline_styles */ public function test_wp_maybe_inline_styles() { - wp_register_style( 'test-handle', '/' . WPINC . '/css/classic-themes.css' ); - wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/classic-themes.css' ); + wp_register_style( 'test-handle', '/' . WPINC . '/css/dashicons.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/dashicons.css' ); wp_enqueue_style( 'test-handle' ); @@ -642,7 +535,7 @@ public function test_wp_maybe_inline_styles() { $this->assertFalse( $GLOBALS['wp_styles']->registered['test-handle']->src, 'Source of style should be reset to false' ); - $css = file_get_contents( ABSPATH . WPINC . '/css/classic-themes.css' ); + $css = file_get_contents( ABSPATH . WPINC . '/css/dashicons.css' ); $this->assertSameSets( $GLOBALS['wp_styles']->registered['test-handle']->extra['after'], array( $css ), 'Source of style should set to after property' ); } @@ -657,8 +550,8 @@ public function test_wp_maybe_inline_styles() { public function test_wp_maybe_inline_styles_multiple_runs() { $filter = new MockAction(); add_filter( 'pre_wp_filesize', array( $filter, 'filter' ) ); - wp_register_style( 'test-handle', '/' . WPINC . '/css/classic-themes.css' ); - wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/classic-themes.css' ); + wp_register_style( 'test-handle', '/' . WPINC . '/css/dashicons.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/dashicons.css' ); wp_enqueue_style( 'test-handle' ); @@ -696,7 +589,7 @@ public function test_test_wp_maybe_inline_styles_missing_file() { */ public function test_wp_maybe_inline_styles_no_src() { wp_register_style( 'test-handle', false ); - wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/classic-themes.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/dashicons.css' ); wp_enqueue_style( 'test-handle' ); @@ -712,7 +605,7 @@ public function test_wp_maybe_inline_styles_no_src() { * @covers ::wp_maybe_inline_styles */ public function test_wp_maybe_inline_styles_no_path() { - $url = '/' . WPINC . '/css/classic-themes.css'; + $url = '/' . WPINC . '/css/dashicons.css'; wp_register_style( 'test-handle', $url ); wp_enqueue_style( 'test-handle' ); @@ -721,5 +614,4 @@ public function test_wp_maybe_inline_styles_no_path() { $this->assertSame( $GLOBALS['wp_styles']->registered['test-handle']->src, $url ); } ->>>>>>> 582ddb82f4 (Script Loader: Improve performance of wp_maybe_inline_styles function. ) } From 2e32650041f790bfd2faf16f9bb68bc0db4c9d1a Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Tue, 31 Oct 2023 17:05:32 +0000 Subject: [PATCH 3/4] WP-r55909: Script Loader: Add a check to see in style is registered in wp_maybe_inline_styles. Add a check in `wp_maybe_inline_styles` to check that style is registered before processing items in queue. It is possible that developers may have called `wp_deregister_style`, unregistering style but the style still be in the queue to be processed. Without this check, typing to access the `src` property would result in a notice error. Follow on from https://core.trac.wordpress.org/changeset/55888. WP:Props spacedmonkey, flixos90, dd32, kebbet. See https://core.trac.wordpress.org/ticket/58394. --- Merges https://core.trac.wordpress.org/changeset/55909 / WordPress/wordpress-develop@559e6cecf4 to ClassicPress. --- src/wp-includes/script-loader.php | 5 ++++- tests/phpunit/tests/dependencies/styles.php | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 20803ce7e0..f08f80db49 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -2128,8 +2128,11 @@ function wp_maybe_inline_styles() { // Build an array of styles that have a path defined. foreach ( $wp_styles->queue as $handle ) { + if ( ! isset( $wp_styles->registered[ $handle ] ) ) { + continue; + } $src = $wp_styles->registered[ $handle ]->src; - $path = wp_styles()->get_data( $handle, 'path' ); + $path = $wp_styles->get_data( $handle, 'path' ); if ( $path && $src ) { $size = wp_filesize( $path ); if ( ! $size ) { diff --git a/tests/phpunit/tests/dependencies/styles.php b/tests/phpunit/tests/dependencies/styles.php index 9a45d409fa..9796b92595 100644 --- a/tests/phpunit/tests/dependencies/styles.php +++ b/tests/phpunit/tests/dependencies/styles.php @@ -539,6 +539,26 @@ public function test_wp_maybe_inline_styles() { $this->assertSameSets( $GLOBALS['wp_styles']->registered['test-handle']->extra['after'], array( $css ), 'Source of style should set to after property' ); } + /** + * @ticket 58394 + * + * @covers ::wp_maybe_inline_styles + */ + public function test_wp_maybe_inline_styles_dequeue_styles() { + $filter = new MockAction(); + add_filter( 'pre_wp_filesize', array( $filter, 'filter' ) ); + wp_register_style( 'test-handle', '/' . WPINC . '/css/classic-themes.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/classic-themes.css' ); + + wp_enqueue_style( 'test-handle' ); + + wp_deregister_style( 'test-handle' ); + + wp_maybe_inline_styles(); + + $this->assertSame( 0, $filter->get_call_count() ); + } + /** * wp_filesize should be only be called once, as on the second run of wp_maybe_inline_styles, * src will be set to false and filesize will not be requested. From e94ab0b6da568781e69af596968029122c622ac2 Mon Sep 17 00:00:00 2001 From: mattyrob Date: Tue, 31 Oct 2023 17:25:02 +0000 Subject: [PATCH 4/4] Use smaller src css for testing purposes --- tests/phpunit/tests/dependencies/styles.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/phpunit/tests/dependencies/styles.php b/tests/phpunit/tests/dependencies/styles.php index 9796b92595..6c88b0e205 100644 --- a/tests/phpunit/tests/dependencies/styles.php +++ b/tests/phpunit/tests/dependencies/styles.php @@ -526,8 +526,8 @@ public function data_styles_with_media() { * @covers ::wp_maybe_inline_styles */ public function test_wp_maybe_inline_styles() { - wp_register_style( 'test-handle', '/' . WPINC . '/css/dashicons.css' ); - wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/dashicons.css' ); + wp_register_style( 'test-handle', '/' . WPINC . '/css/wp-pointer.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/wp-pointer.css' ); wp_enqueue_style( 'test-handle' ); @@ -535,7 +535,7 @@ public function test_wp_maybe_inline_styles() { $this->assertFalse( $GLOBALS['wp_styles']->registered['test-handle']->src, 'Source of style should be reset to false' ); - $css = file_get_contents( ABSPATH . WPINC . '/css/dashicons.css' ); + $css = file_get_contents( ABSPATH . WPINC . '/css/wp-pointer.css' ); $this->assertSameSets( $GLOBALS['wp_styles']->registered['test-handle']->extra['after'], array( $css ), 'Source of style should set to after property' ); } @@ -547,8 +547,8 @@ public function test_wp_maybe_inline_styles() { public function test_wp_maybe_inline_styles_dequeue_styles() { $filter = new MockAction(); add_filter( 'pre_wp_filesize', array( $filter, 'filter' ) ); - wp_register_style( 'test-handle', '/' . WPINC . '/css/classic-themes.css' ); - wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/classic-themes.css' ); + wp_register_style( 'test-handle', '/' . WPINC . '/css/wp-pointer.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/wp-pointer.css' ); wp_enqueue_style( 'test-handle' ); @@ -570,8 +570,8 @@ public function test_wp_maybe_inline_styles_dequeue_styles() { public function test_wp_maybe_inline_styles_multiple_runs() { $filter = new MockAction(); add_filter( 'pre_wp_filesize', array( $filter, 'filter' ) ); - wp_register_style( 'test-handle', '/' . WPINC . '/css/dashicons.css' ); - wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/dashicons.css' ); + wp_register_style( 'test-handle', '/' . WPINC . '/css/wp-pointer.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/wp-pointer.css' ); wp_enqueue_style( 'test-handle' ); @@ -609,7 +609,7 @@ public function test_test_wp_maybe_inline_styles_missing_file() { */ public function test_wp_maybe_inline_styles_no_src() { wp_register_style( 'test-handle', false ); - wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/dashicons.css' ); + wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/wp-pointer.css' ); wp_enqueue_style( 'test-handle' ); @@ -625,7 +625,7 @@ public function test_wp_maybe_inline_styles_no_src() { * @covers ::wp_maybe_inline_styles */ public function test_wp_maybe_inline_styles_no_path() { - $url = '/' . WPINC . '/css/dashicons.css'; + $url = '/' . WPINC . '/css/wp-pointer.css'; wp_register_style( 'test-handle', $url ); wp_enqueue_style( 'test-handle' );