diff options
author | Michael Hamann <michael@content-space.de> | 2014-03-14 13:11:30 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2014-03-14 13:11:30 +0100 |
commit | 882bc5d2afc0dfa289e35bc1ec6c99d54ead7660 (patch) | |
tree | b211d4acad42bb037174153908011b57b402446d /_test | |
parent | bc2ddb548f71b1a822dd03c3bc7c3c0e7cd9b152 (diff) | |
parent | 16ca217de8ce72a9c736f35f1a62718437369d88 (diff) | |
download | rpg-882bc5d2afc0dfa289e35bc1ec6c99d54ead7660.tar.gz rpg-882bc5d2afc0dfa289e35bc1ec6c99d54ead7660.tar.bz2 |
Merge branch 'master' into event_warning
Diffstat (limited to '_test')
-rw-r--r-- | _test/tests/inc/cache_use.test.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/_test/tests/inc/cache_use.test.php b/_test/tests/inc/cache_use.test.php new file mode 100644 index 000000000..f5349df13 --- /dev/null +++ b/_test/tests/inc/cache_use.test.php @@ -0,0 +1,36 @@ +<?php + +/** + * Class cache_use_test + * + * Tests if caching can actually be used + */ +class cache_use_test extends DokuWikiTest { + /** @var cache_renderer $cache */ + private $cache; + + function setUp() { + global $ID; + parent::setUp(); + + $ID = 'cached'; + $file = wikiFN($ID); + + saveWikiText($ID, 'Content', 'Created'); + // set the modification time a second in the past in order to ensure that the cache is newer than the page + touch($file, time()-1); + + # Create cache. Note that the metadata cache is used as the xhtml cache triggers metadata rendering + $this->cache = new cache_renderer($ID, $file, 'metadata'); + $this->cache->storeCache('Test'); + } + + function test_use() { + $this->assertTrue($this->cache->useCache()); + } + + + function test_purge() { + $this->assertFalse($this->cache->useCache(array('purge' => true))); + } +}
\ No newline at end of file |