Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes a WP nightly unity test #34190

Merged
merged 2 commits into from Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions plugins/woocommerce/changelog/fix-unit-nightly
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: Fixes a unit test for WP nightly. No functional change.


Expand Up @@ -57,8 +57,10 @@ protected function clear_template_cache() {
$cached_templates = wp_cache_get( 'cached_templates', 'woocommerce' );
wc_clear_template_cache();

foreach ( (array) $cached_templates as $template ) {
$this->assertEmpty( wp_cache_get( $template, 'woocommerce' ) );
if ( $cached_templates ) {
foreach ( (array) $cached_templates as $template ) {
$this->assertEmpty( wp_cache_get( $template, 'woocommerce' ) );
}
}
$this->assertEmpty( wp_cache_get( 'cached_templates', 'woocommerce' ) );
}
Expand Down