From 9ce0cac3f49ad03559036e539da41e0db0a5045d Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Wed, 30 Sep 2026 11:24:55 -0700 Subject: [PATCH] Tests: Use `wp_styles()` in the styles ETag test. `test_get_etag_styles()` enqueues styles but calls `get_etag()` on `wp_scripts()`. Its "should accept one dependency" case only passed because `test_get_etag_scripts()` had already registered the same script handle and version on `wp_scripts()` and nothing reset it. Run alone, in reverse order, or at some random seeds, that case got the hash for an empty list instead. The test now reads the ETag from `wp_styles()`, the instance it enqueues to. See #65893. Co-Authored-By: Claude Opus 5.5 --- tests/phpunit/tests/dependencies.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/tests/dependencies.php b/tests/phpunit/tests/dependencies.php index dfcd253239583..a9a9efa2d5256 100644 --- a/tests/phpunit/tests/dependencies.php +++ b/tests/phpunit/tests/dependencies.php @@ -224,7 +224,7 @@ public function test_get_etag_styles( $load, $hash_source_string, $expected ) { // Modify global to avoid tests needing to change with each new version of WordPress. $original_wp_version = $wp_version; $wp_version = '6.7'; - $instance = wp_scripts(); + $instance = wp_styles(); foreach ( $load as $handle => $ver ) { // The src should not be empty.