diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-10 06:04:24 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-10 06:04:24 -0500 |
commit | 3c542b852a99f62337c8cf1c6d3e6551c4e3dca1 (patch) | |
tree | ff97ac0990809dcf22657da4285516d086a06aa0 /tests/mock | |
parent | b5f94a14f1a5c77366f824780f1120a1b5e9184a (diff) | |
parent | ff993ba9d30f5de49e5231647c5bb76d95c357f8 (diff) | |
download | forums-3c542b852a99f62337c8cf1c6d3e6551c4e3dca1.tar forums-3c542b852a99f62337c8cf1c6d3e6551c4e3dca1.tar.gz forums-3c542b852a99f62337c8cf1c6d3e6551c4e3dca1.tar.bz2 forums-3c542b852a99f62337c8cf1c6d3e6551c4e3dca1.tar.xz forums-3c542b852a99f62337c8cf1c6d3e6551c4e3dca1.zip |
Merge PR #1125 branch 'p/ticket/10972' into develop-olympus
* p/ticket/10972:
[ticket/10972] Drop user deletion.
[ticket/10972] Tweak user addition.
[ticket/10972] Add destroy method to mock cache.
[ticket/10972] Add mock null cache.
[ticket/10972] Backport get_db from develop.
[ticket/10972] Added explicit checks for creating duplicate users.
[ticket/10972] Moved tests into appropriate places and added comments
[ticket/10972] Added methods for creating and deleting basic users
Diffstat (limited to 'tests/mock')
-rw-r--r-- | tests/mock/cache.php | 12 | ||||
-rw-r--r-- | tests/mock/null_cache.php | 42 |
2 files changed, 53 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. diff --git a/tests/mock/null_cache.php b/tests/mock/null_cache.php new file mode 100644 index 0000000000..aca20ca77b --- /dev/null +++ b/tests/mock/null_cache.php @@ -0,0 +1,42 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class phpbb_mock_null_cache +{ + public function __construct() + { + } + + public function get($var_name) + { + return false; + } + + public function put($var_name, $var, $ttl = 0) + { + } + + public function destroy($var_name, $table = '') + { + } + + public function obtain_bots() + { + return array(); + } + + public function obtain_word_list() + { + return array(); + } + + public function set_bots($bots) + { + } +} |