aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mock/cache.php
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-12-06 23:42:13 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-12-06 23:42:13 -0500
commit1285bdff00ecf928783698b86205888a2bd8bee7 (patch)
tree550bb4c20e4b23d937bf7067718ed311498364fd /tests/mock/cache.php
parent771bb957ab4dee865ce1678eb675c37874d04e98 (diff)
downloadforums-1285bdff00ecf928783698b86205888a2bd8bee7.tar
forums-1285bdff00ecf928783698b86205888a2bd8bee7.tar.gz
forums-1285bdff00ecf928783698b86205888a2bd8bee7.tar.bz2
forums-1285bdff00ecf928783698b86205888a2bd8bee7.tar.xz
forums-1285bdff00ecf928783698b86205888a2bd8bee7.zip
[ticket/10972] Add destroy method to mock cache.
I actually needed the version that destroys tables, therefore I ended up writing a mock null cache. This code is currently unused but will probably be handy at some point. PHPBB3-10972
Diffstat (limited to 'tests/mock/cache.php')
-rw-r--r--tests/mock/cache.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/mock/cache.php b/tests/mock/cache.php
index 650545c3d6..aa0db5ab20 100644
--- a/tests/mock/cache.php
+++ b/tests/mock/cache.php
@@ -34,6 +34,16 @@ class phpbb_mock_cache
$this->data[$var_name] = $var;
}
+ public function destroy($var_name, $table = '')
+ {
+ if ($table)
+ {
+ throw new Exception('Destroying tables is not implemented yet');
+ }
+
+ unset($this->data[$var_name]);
+ }
+
/**
* Obtain active bots
*/
@@ -41,7 +51,7 @@ class phpbb_mock_cache
{
return $this->data['_bots'];
}
-
+
/**
* Obtain list of word censors. We don't need to parse them here,
* that is tested elsewhere.