diff options
| author | Igor Wiedler <igor@wiedler.ch> | 2011-01-09 23:58:27 +0100 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2011-01-09 23:58:27 +0100 |
| commit | 95c683056b85399200e2caaa9aa65edc6843c16f (patch) | |
| tree | ac11043ba149791a225d587e7a61e34db75a04f6 /tests/mock | |
| parent | 5373f8157d8a2619197702c3a00a6bb432ef3e25 (diff) | |
| parent | 1aef7eb20ee195c7f21d6c5b78653b7c43e669ec (diff) | |
| download | forums-95c683056b85399200e2caaa9aa65edc6843c16f.tar forums-95c683056b85399200e2caaa9aa65edc6843c16f.tar.gz forums-95c683056b85399200e2caaa9aa65edc6843c16f.tar.bz2 forums-95c683056b85399200e2caaa9aa65edc6843c16f.tar.xz forums-95c683056b85399200e2caaa9aa65edc6843c16f.zip | |
Merge branch 'task/acm-refactor' into develop
Conflicts:
tests/bootstrap.php
Diffstat (limited to 'tests/mock')
| -rw-r--r-- | tests/mock/cache.php | 87 |
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) + { + } +} |
