From 16ca217de8ce72a9c736f35f1a62718437369d88 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Fri, 14 Mar 2014 13:08:32 +0100 Subject: Add a basic test case for the cache This very basic test ensures that the useCache method works as expected for simple scenarios. This test case fails without commit a8795974051a91137b01ff88dbf5586a647b24ce and then also triggers the warning that was introduced in bc2ddb548f71b1a822dd03c3bc7c3c0e7cd9b152 --- _test/tests/inc/cache_use.test.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 _test/tests/inc/cache_use.test.php (limited to '_test/tests/inc/cache_use.test.php') 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 @@ +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 -- cgit v1.2.3