aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mock
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-07-11 17:30:32 -0400
committerMarc Alexander <admin@m-a-styles.de>2013-07-11 17:30:32 -0400
commitdc4687501a16b2c50a9ebfcb9f941a02d9572764 (patch)
tree58277fdfd34f4ee4381e8b6827efdd0ab58f0def /tests/mock
parent599f83395f90c9a899b0e639ba5acacfb8ae372b (diff)
parent94e5bfaadad3be2bcda5347754c3f1b5be33c620 (diff)
downloadforums-dc4687501a16b2c50a9ebfcb9f941a02d9572764.tar
forums-dc4687501a16b2c50a9ebfcb9f941a02d9572764.tar.gz
forums-dc4687501a16b2c50a9ebfcb9f941a02d9572764.tar.bz2
forums-dc4687501a16b2c50a9ebfcb9f941a02d9572764.tar.xz
forums-dc4687501a16b2c50a9ebfcb9f941a02d9572764.zip
Merge branch 'develop-olympus' of https://github.com/phpbb/phpbb3 into ticket/11548
Diffstat (limited to 'tests/mock')
-rw-r--r--tests/mock/cache.php15
-rw-r--r--tests/mock/user.php13
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/mock/cache.php b/tests/mock/cache.php
index aa0db5ab20..acf4288319 100644
--- a/tests/mock/cache.php
+++ b/tests/mock/cache.php
@@ -74,6 +74,21 @@ class phpbb_mock_cache
);
}
+ /**
+ * 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 set_bots($bots)
{
$this->data['_bots'] = $bots;
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;
+ }
}