Fixed Broken Cache Test When Path Tokenized
Since the template path is tokenized, it's possible that in different testing environments the contents of the cache will be different than the template file path on the filesystem. We can make sure they are the same by untokenizing the cached path before the assertion.
This commit is contained in:
parent
c5cec0fe30
commit
5ca9c47563
|
@ -43,7 +43,9 @@ class WC_Template_Cache extends WC_Unit_Test_Case {
|
|||
|
||||
// Check individual templates.
|
||||
foreach ( $templates as $cache_key => $template ) {
|
||||
$this->assertEquals( $template, wp_cache_get( $cache_key, 'woocommerce' ) );
|
||||
// The cache contents may be tokenized and we need to untokenize it for the assertion.
|
||||
$from_cache = wc_untokenize_path( wp_cache_get( $cache_key, 'woocommerce' ), wc_get_path_define_tokens() );
|
||||
$this->assertEquals( $template, $from_cache );
|
||||
}
|
||||
|
||||
// Clear cache.
|
||||
|
|
Loading…
Reference in New Issue