Skip to content
Snippets Groups Projects
Commit 0d24b616 authored by Michael Hamann's avatar Michael Hamann
Browse files

Disable some parser and renderer caches during tests FS#2564

This disables some caches which use static variables in order to prevent
parsing or rendering of the same page more than once during a run and
also disables the cache of parser modes. This means we can no longer
test this behavior but at least it fixes syntax plugin tests and tests
which change pages in order to test certain caching behaviors.
parent b3d1090e
No related branches found
No related tags found
No related merge requests found
......@@ -212,7 +212,7 @@ function p_cached_instructions($file,$cacheonly=false,$id='') {
$cache = new cache_instructions($id, $file);
if ($cacheonly || $cache->useCache() || isset($run[$file])) {
if ($cacheonly || $cache->useCache() || (isset($run[$file]) && !defined('DOKU_UNITTEST'))) {
return $cache->retrieveCache();
} else if (@file_exists($file)) {
// no cache - do some work
......@@ -311,8 +311,10 @@ function p_get_metadata($id, $key='', $render=METADATA_RENDER_USING_CACHE){
}
}
if ($do_render) {
++$render_count;
$rendered_pages[$id] = true;
if (!defined('DOKU_UNITTEST')) {
++$render_count;
$rendered_pages[$id] = true;
}
$old_meta = $meta;
$meta = p_render_metadata($id, $meta);
// only update the file when the metadata has been changed
......@@ -547,7 +549,7 @@ function p_get_parsermodes(){
//reuse old data
static $modes = null;
if($modes != null){
if($modes != null && !defined('DOKU_UNITTEST')){
return $modes;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment