diff options
Diffstat (limited to 'tests/mock')
-rw-r--r-- | tests/mock/cache.php | 15 | ||||
-rw-r--r-- | tests/mock/lang.php | 5 | ||||
-rw-r--r-- | tests/mock/user.php | 13 |
3 files changed, 33 insertions, 0 deletions
diff --git a/tests/mock/cache.php b/tests/mock/cache.php index 71af3037f5..440592665a 100644 --- a/tests/mock/cache.php +++ b/tests/mock/cache.php @@ -53,6 +53,21 @@ class phpbb_mock_cache implements phpbb_cache_driver_interface ); } + /** + * Obtain disallowed usernames. Input data via standard put method. + */ + public function obtain_disallowed_usernames() + { + if (($usernames = $this->get('_disallowed_usernames')) !== false) + { + return $usernames; + } + else + { + return array(); + } + } + public function checkVar(PHPUnit_Framework_Assert $test, $var_name, $data) { $test->assertTrue(isset($this->data[$var_name])); diff --git a/tests/mock/lang.php b/tests/mock/lang.php index 781b3d060e..ac814b45db 100644 --- a/tests/mock/lang.php +++ b/tests/mock/lang.php @@ -30,4 +30,9 @@ class phpbb_mock_lang implements ArrayAccess public function offsetUnset($offset) { } + + public function lang() + { + return implode(' ', func_get_args()); + } } diff --git a/tests/mock/user.php b/tests/mock/user.php index ec14ce430e..bd547b3973 100644 --- a/tests/mock/user.php +++ b/tests/mock/user.php @@ -33,4 +33,17 @@ class phpbb_mock_user { $this->options[$item] = $value; } + + public function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false) + { + $banned_users = $this->optionget('banned_users'); + foreach ($banned_users as $banned) + { + if ($banned == $user_id || $banned == $user_ips || $banned == $user_email) + { + return true; + } + } + return false; + } } |