aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functions
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2019-09-20 22:23:06 +0200
committerMarc Alexander <admin@m-a-styles.de>2019-09-20 22:23:06 +0200
commita7c02304a56e29c0fd4833626ec692a6babcb269 (patch)
tree8faf99cb5e786106c1c8ccfa5d2091e2759d2fb0 /tests/functions
parentd6139846607a4fe3a13d5863b3fa6a52b1fe3c10 (diff)
parentf0afccb173fb728b6c70a8bd86c4d8869043581a (diff)
downloadforums-a7c02304a56e29c0fd4833626ec692a6babcb269.tar
forums-a7c02304a56e29c0fd4833626ec692a6babcb269.tar.gz
forums-a7c02304a56e29c0fd4833626ec692a6babcb269.tar.bz2
forums-a7c02304a56e29c0fd4833626ec692a6babcb269.tar.xz
forums-a7c02304a56e29c0fd4833626ec692a6babcb269.zip
Merge branch '3.2.x' into 3.3.x
Diffstat (limited to 'tests/functions')
-rw-r--r--tests/functions/fixtures/validate_email.xml24
-rw-r--r--tests/functions/validate_user_email_test.php12
2 files changed, 33 insertions, 3 deletions
diff --git a/tests/functions/fixtures/validate_email.xml b/tests/functions/fixtures/validate_email.xml
index eb4fd90217..fa139f6f18 100644
--- a/tests/functions/fixtures/validate_email.xml
+++ b/tests/functions/fixtures/validate_email.xml
@@ -1,5 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
+ <table name="phpbb_banlist">
+ <column>ban_id</column>
+ <column>ban_userid</column>
+ <column>ban_exclude</column>
+ <column>ban_end</column>
+ <column>ban_email</column>
+ <column>ban_give_reason</column>
+ <row>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>banned@example.com</value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>banned2@example.com</value>
+ <value>just because</value>
+ </row>
+ </table>
<table name="phpbb_users">
<column>user_id</column>
<column>username</column>
diff --git a/tests/functions/validate_user_email_test.php b/tests/functions/validate_user_email_test.php
index a05a7808a4..eeb5bfc2a9 100644
--- a/tests/functions/validate_user_email_test.php
+++ b/tests/functions/validate_user_email_test.php
@@ -28,10 +28,16 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
protected function setUp(): void
{
+ global $cache, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
+
parent::setUp();
+ $cache = new \phpbb\cache\driver\file();
+ $cache->purge();
$this->db = $this->new_dbal();
- $this->user = new phpbb_mock_user;
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $language = new phpbb\language\language(new phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
+ $this->user = new phpbb\user($language, '\phpbb\datetime');
$this->helper = new phpbb_functions_validate_data_helper($this);
}
@@ -47,7 +53,6 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
$config['email_check_mx'] = $check_mx;
$db = $this->db;
$user = $this->user;
- $user->optionset('banned_users', array('banned@example.com'));
}
public static function validate_user_email_data()
@@ -58,7 +63,8 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
array('valid_complex', array(), "'%$~test@example.com"),
array('invalid', array('EMAIL_INVALID'), 'fööbar@example.com'),
array('taken', array('EMAIL_TAKEN'), 'admin@example.com'),
- array('banned', array('EMAIL_BANNED'), 'banned@example.com'),
+ array('banned', ['just because'], 'banned2@example.com'),
+ array('banned', ['EMAIL_BANNED'], 'banned@example.com')
);
}