aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mock/cache.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-01-09 21:09:56 +0100
committerIgor Wiedler <igor@wiedler.ch>2011-01-09 23:49:44 +0100
commit1aef7eb20ee195c7f21d6c5b78653b7c43e669ec (patch)
treeac11043ba149791a225d587e7a61e34db75a04f6 /tests/mock/cache.php
parent9329b16ab13f3a4caf107df358c3c58bda2dcd8a (diff)
downloadforums-1aef7eb20ee195c7f21d6c5b78653b7c43e669ec.tar
forums-1aef7eb20ee195c7f21d6c5b78653b7c43e669ec.tar.gz
forums-1aef7eb20ee195c7f21d6c5b78653b7c43e669ec.tar.bz2
forums-1aef7eb20ee195c7f21d6c5b78653b7c43e669ec.tar.xz
forums-1aef7eb20ee195c7f21d6c5b78653b7c43e669ec.zip
[task/acm-refactor] Cleaning up left over mentions of ACM and fixing tests.
PHPBB3-9983
Diffstat (limited to 'tests/mock/cache.php')
-rw-r--r--tests/mock/cache.php87
1 files changed, 87 insertions, 0 deletions
diff --git a/tests/mock/cache.php b/tests/mock/cache.php
new file mode 100644
index 0000000000..3bfb31f1be
--- /dev/null
+++ b/tests/mock/cache.php
@@ -0,0 +1,87 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+class phpbb_mock_cache implements phpbb_cache_driver_interface
+{
+ protected $data;
+
+ public function __construct($data = array())
+ {
+ $this->data = $data;
+ }
+
+ public function get($var_name)
+ {
+ if (isset($this->data[$var_name]))
+ {
+ return $this->data[$var_name];
+ }
+
+ return false;
+ }
+
+ public function put($var_name, $var, $ttl = 0)
+ {
+ $this->data[$var_name] = $var;
+ }
+
+ public function checkVar(PHPUnit_Framework_Assert $test, $var_name, $data)
+ {
+ $test->assertTrue(isset($this->data[$var_name]));
+ $test->assertEquals($data, $this->data[$var_name]);
+ }
+
+ public function check(PHPUnit_Framework_Assert $test, $data)
+ {
+ $test->assertEquals($data, $this->data);
+ }
+
+ function load()
+ {
+ }
+ function unload()
+ {
+ }
+ function save()
+ {
+ }
+ function tidy()
+ {
+ }
+ function purge()
+ {
+ }
+ function destroy($var_name, $table = '')
+ {
+ }
+ public function _exists($var_name)
+ {
+ }
+ public function sql_load($query)
+ {
+ }
+ public function sql_save($query, &$query_result, $ttl)
+ {
+ }
+ public function sql_exists($query_id)
+ {
+ }
+ public function sql_fetchrow($query_id)
+ {
+ }
+ public function sql_fetchfield($query_id, $field)
+ {
+ }
+ public function sql_rowseek($rownum, $query_id)
+ {
+ }
+ public function sql_freeresult($query_id)
+ {
+ }
+}