diff --git a/phpunit/class-wp-theme-json-resolver-test.php b/phpunit/class-wp-theme-json-resolver-test.php index 614be1a403a3a..bed1a171263f4 100644 --- a/phpunit/class-wp-theme-json-resolver-test.php +++ b/phpunit/class-wp-theme-json-resolver-test.php @@ -1369,8 +1369,8 @@ public function test_get_resolved_theme_uris() { $this->assertSame( $expected_data, $actual, 'Resolved theme uris do not match.' ); // Test that resolved theme uris are cached. - $current_stylesheet_directory = get_stylesheet_directory(); - $expected_cache_data = array( "$current_stylesheet_directory" => $actual ); + $cache_key = md5( wp_json_encode( $theme_json->get_raw_data() ) ); + $expected_cache_data = array( "$cache_key" => $actual ); $this->assertSame( $expected_cache_data, static::$property_resolved_theme_uris_cache->getValue(), 'Resolved theme uris cache data does not match.' ); }