mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/11579] Add method for validating emails for valid MX and mark as slow [ticket/11579] Do not extend validate_data_helper [ticket/11579] Add missing commas to validate_username_test [ticket/11579] Rework calls to validate_data_helper [ticket/11579] Move simple tests into seperate files [ticket/11579] Use test case helper class and use assert prefix for method [ticket/11579] Move tests into seperate files depending on needed fixture [ticket/11579] Remove unnecessary globals from validate_password() [ticket/11579] Add remaining unit tests for validate_data functions [ticket/11579] Add basic set of unit tests for validate_data() Conflicts: tests/mock/cache.php
This commit is contained in:
@@ -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]));
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user