From b7f54e42b269374f018fe67ece11e63cf86b0c12 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 15 May 2014 00:22:27 +0200 Subject: [ticket/11224] Add unit test PHPBB3-11224 --- tests/cache/cache_memory.php | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tests/cache/cache_memory.php (limited to 'tests/cache/cache_memory.php') diff --git a/tests/cache/cache_memory.php b/tests/cache/cache_memory.php new file mode 100644 index 0000000000..c468cb4658 --- /dev/null +++ b/tests/cache/cache_memory.php @@ -0,0 +1,62 @@ +data[$var]; + } + + /** + * Store data in the cache + * + * @access protected + * @param string $var Cache key + * @param mixed $data Data to store + * @param int $ttl Time-to-live of cached data + * @return bool True if the operation succeeded + */ + function _write($var, $data, $ttl = 2592000) + { + $this->data[$var] = $data; + return true; + } + + /** + * Remove an item from the cache + * + * @access protected + * @param string $var Cache key + * @return bool True if the operation succeeded + */ + function _delete($var) + { + unset($this->data[$var]); + return true; + } +} -- cgit v1.2.1