Fixes a WP nightly unity test (#34190)
* Dont check for cache when there are no cached templates. * Add changelog.
This commit is contained in:
parent
0e0212254e
commit
5f0efcf02f
|
@ -0,0 +1,5 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
Comment: Fixes a unit test for WP nightly. No functional change.
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,10 @@ class WC_Template_Cache extends WC_Unit_Test_Case {
|
||||||
$cached_templates = wp_cache_get( 'cached_templates', 'woocommerce' );
|
$cached_templates = wp_cache_get( 'cached_templates', 'woocommerce' );
|
||||||
wc_clear_template_cache();
|
wc_clear_template_cache();
|
||||||
|
|
||||||
foreach ( (array) $cached_templates as $template ) {
|
if ( $cached_templates ) {
|
||||||
$this->assertEmpty( wp_cache_get( $template, 'woocommerce' ) );
|
foreach ( (array) $cached_templates as $template ) {
|
||||||
|
$this->assertEmpty( wp_cache_get( $template, 'woocommerce' ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->assertEmpty( wp_cache_get( 'cached_templates', 'woocommerce' ) );
|
$this->assertEmpty( wp_cache_get( 'cached_templates', 'woocommerce' ) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue