aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functions
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functions')
-rw-r--r--tests/functions/build_hidden_fields_for_query_params_test.php2
-rw-r--r--tests/functions/build_url_test.php4
-rw-r--r--tests/functions/convert_30_dbms_to_31_test.php4
-rw-r--r--tests/functions/fixtures/validate_email.xml24
-rw-r--r--tests/functions/fixtures/validate_username.xml2
-rw-r--r--tests/functions/generate_string_list.php12
-rw-r--r--tests/functions/get_formatted_filesize_test.php2
-rw-r--r--tests/functions/get_preg_expression_test.php2
-rw-r--r--tests/functions/get_remote_file_test.php5
-rw-r--r--tests/functions/is_absolute_test.php60
-rw-r--r--tests/functions/language_select_test.php2
-rw-r--r--tests/functions/make_clickable_email_test.php8
-rw-r--r--tests/functions/make_clickable_test.php18
-rw-r--r--tests/functions/obtain_online_test.php3
-rw-r--r--tests/functions/parse_cfg_file_test.php2
-rw-r--r--tests/functions/quoteattr_test.php2
-rw-r--r--tests/functions/style_select_test.php2
-rw-r--r--tests/functions/user_delete_test.php17
-rw-r--r--tests/functions/validate_email_test.php1
-rw-r--r--tests/functions/validate_password_test.php1
-rw-r--r--tests/functions/validate_string_test.php1
-rw-r--r--tests/functions/validate_user_email_test.php13
-rw-r--r--tests/functions/validate_username_test.php13
23 files changed, 84 insertions, 116 deletions
diff --git a/tests/functions/build_hidden_fields_for_query_params_test.php b/tests/functions/build_hidden_fields_for_query_params_test.php
index 14cb4b9a94..aee7a569d4 100644
--- a/tests/functions/build_hidden_fields_for_query_params_test.php
+++ b/tests/functions/build_hidden_fields_for_query_params_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_build_hidden_fields_for_query_params_test extends phpbb_test_case
{
public function build_hidden_fields_for_query_params_test_data()
diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php
index a59b94c744..91a4a9ec66 100644
--- a/tests/functions/build_url_test.php
+++ b/tests/functions/build_url_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_build_url_test extends phpbb_test_case
{
protected function setUp()
@@ -29,7 +27,7 @@ class phpbb_build_url_test extends phpbb_test_case
new \phpbb\symfony_request(
new phpbb_mock_request()
),
- new \phpbb\filesystem(),
+ new \phpbb\filesystem\filesystem(),
$this->getMock('\phpbb\request\request'),
$phpbb_root_path,
'php'
diff --git a/tests/functions/convert_30_dbms_to_31_test.php b/tests/functions/convert_30_dbms_to_31_test.php
index 729c0a82f0..456eb64461 100644
--- a/tests/functions/convert_30_dbms_to_31_test.php
+++ b/tests/functions/convert_30_dbms_to_31_test.php
@@ -11,21 +11,17 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case
{
public function convert_30_dbms_to_31_data()
{
return array(
- array('mssql'),
array('mssql_odbc'),
array('mssqlnative'),
array('mysql'),
array('mysqli'),
array('oracle'),
array('postgres'),
- array('sqlite'),
);
}
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/fixtures/validate_username.xml b/tests/functions/fixtures/validate_username.xml
index 1b85a2f06d..add8f76553 100644
--- a/tests/functions/fixtures/validate_username.xml
+++ b/tests/functions/fixtures/validate_username.xml
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dataset>
<table name="phpbb_groups">
+ <column>group_id</column>
<column>group_name</column>
<column>group_desc</column>
<row>
+ <value>10</value>
<value>foobar_group</value>
<value>test123</value>
</row>
diff --git a/tests/functions/generate_string_list.php b/tests/functions/generate_string_list.php
index cd1e37618a..6eddb1395e 100644
--- a/tests/functions/generate_string_list.php
+++ b/tests/functions/generate_string_list.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_generate_string_list_test extends phpbb_test_case
{
public $user;
@@ -22,7 +19,12 @@ class phpbb_generate_string_list_test extends phpbb_test_case
{
parent::setUp();
- $this->user = new \phpbb\user('\phpbb\datetime');
+ global $phpbb_root_path, $phpEx;
+
+ $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
+ $lang = new \phpbb\language\language($lang_loader);
+ $user = new \phpbb\user($lang, '\phpbb\datetime');
+ $this->user = $user;
$this->user->data = array('user_lang' => 'en');
$this->user->add_lang('common');
}
@@ -36,7 +38,7 @@ class phpbb_generate_string_list_test extends phpbb_test_case
),
array(
array('A'),
- 'A',
+ 'A',
),
array(
array(2 => 'A', 3 => 'B'),
diff --git a/tests/functions/get_formatted_filesize_test.php b/tests/functions/get_formatted_filesize_test.php
index 635753d737..290515b64f 100644
--- a/tests/functions/get_formatted_filesize_test.php
+++ b/tests/functions/get_formatted_filesize_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_get_formatted_filesize_test extends phpbb_test_case
{
public function get_formatted_filesize_test_data()
diff --git a/tests/functions/get_preg_expression_test.php b/tests/functions/get_preg_expression_test.php
index e74017d315..b8254b03ea 100644
--- a/tests/functions/get_preg_expression_test.php
+++ b/tests/functions/get_preg_expression_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_functions_get_preg_expression_test extends phpbb_test_case
{
public function data_path_remove_dot_trailing_slash()
diff --git a/tests/functions/get_remote_file_test.php b/tests/functions/get_remote_file_test.php
index 612d82273e..75e5a6dc61 100644
--- a/tests/functions/get_remote_file_test.php
+++ b/tests/functions/get_remote_file_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
-
/**
* @group slow
*/
@@ -61,7 +58,7 @@ class phpbb_functions_get_remote_file extends phpbb_test_case
$this->assertGreaterThanOrEqual(
2,
- sizeof($lines),
+ count($lines),
'Failed asserting that the version file has at least two lines.'
);
diff --git a/tests/functions/is_absolute_test.php b/tests/functions/is_absolute_test.php
deleted file mode 100644
index afa4b9b59f..0000000000
--- a/tests/functions/is_absolute_test.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
-class phpbb_functions_is_absolute_test extends phpbb_test_case
-{
- static public function is_absolute_data()
- {
- return array(
- // Empty
- array('', false),
-
- // Absolute unix style
- array('/etc/phpbb', true),
- // Unix does not support \ so that is not an absolute path
- array('\etc\phpbb', false),
-
- // Absolute windows style
- array('c:\windows', true),
- array('C:\Windows', true),
- array('c:/windows', true),
- array('C:/Windows', true),
-
- // Executable
- array('etc/phpbb', false),
- array('explorer.exe', false),
-
- // Relative subdir
- array('Windows\System32', false),
- array('Windows\System32\explorer.exe', false),
- array('Windows/System32', false),
- array('Windows/System32/explorer.exe', false),
-
- // Relative updir
- array('..\Windows\System32', false),
- array('..\Windows\System32\explorer.exe', false),
- array('../Windows/System32', false),
- array('../Windows/System32/explorer.exe', false),
- );
- }
-
- /**
- * @dataProvider is_absolute_data
- */
- public function test_is_absolute($path, $expected)
- {
- $this->assertEquals($expected, phpbb_is_absolute($path));
- }
-}
diff --git a/tests/functions/language_select_test.php b/tests/functions/language_select_test.php
index 6762ead5a1..2d1296d72f 100644
--- a/tests/functions/language_select_test.php
+++ b/tests/functions/language_select_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_functions_language_select_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php
index 4c802d0487..d481bde80d 100644
--- a/tests/functions/make_clickable_email_test.php
+++ b/tests/functions/make_clickable_email_test.php
@@ -11,18 +11,16 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_functions_make_clickable_email_test extends phpbb_test_case
{
protected function setUp()
{
parent::setUp();
- global $config, $user, $request;
+ global $config, $user, $request, $symfony_request;
$user = new phpbb_mock_user();
$request = new phpbb_mock_request();
+ $symfony_request = new \phpbb\symfony_request($request);
}
/**
@@ -171,7 +169,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case
array('abc,def@example.com'), // invalid character ,
array('abc<def@example.com'), // invalid character <
array('abc>def@example.com', 'abc><!-- e --><a href="mailto:def@example.com">def@example.com</a><!-- e -->'), // invalid character >
-
+
// http://fightingforalostcause.net/misc/2006/compare-email-regex.php
array('missingDomain@.com'),
array('@missingLocal.org'),
diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php
index 63beeb06b2..a6af12b624 100644
--- a/tests/functions/make_clickable_test.php
+++ b/tests/functions/make_clickable_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_functions_make_clickable_test extends phpbb_test_case
{
/**
@@ -56,6 +53,14 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
'<!-- l --><a class="postlink-local" href="http://testhost/viewtopic.php?t=1">viewtopic.php?t=1</a><!-- l -->'
),
array(
+ 'javascript://testhost/viewtopic.php?t=1',
+ 'javascript://testhost/viewtopic.php?t=1'
+ ),
+ array(
+ "java\nscri\npt://testhost/viewtopic.php?t=1",
+ "java\nscri\n<!-- m --><a class=\"postlink\" href=\"pt://testhost/viewtopic.php?t=1\">pt://testhost/viewtopic.php?t=1</a><!-- m -->"
+ ),
+ array(
'email@domain.com',
'<!-- e --><a href="mailto:email@domain.com">email@domain.com</a><!-- e -->'
),
@@ -93,6 +98,10 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
'<!-- m --><a class="postlink" href="ftp://ftp.täst.de/">ftp://ftp.täst.de/</a><!-- m -->'
),
array(
+ 'javascript://täst.de/',
+ 'javascript://täst.de/'
+ ),
+ array(
'sip://bantu@täst.de',
'<!-- m --><a class="postlink" href="sip://bantu@täst.de">sip://bantu@täst.de</a><!-- m -->'
),
@@ -149,9 +158,10 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case
{
parent::setUp();
- global $config, $user, $request;
+ global $config, $user, $request, $symfony_request;
$user = new phpbb_mock_user();
$request = new phpbb_mock_request();
+ $symfony_request = new \phpbb\symfony_request($request);
}
/**
diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php
index e793a4eb82..778753e5d2 100644
--- a/tests/functions/obtain_online_test.php
+++ b/tests/functions/obtain_online_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_functions_obtain_online_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/functions/parse_cfg_file_test.php b/tests/functions/parse_cfg_file_test.php
index b47e25fbc1..017a931f28 100644
--- a/tests/functions/parse_cfg_file_test.php
+++ b/tests/functions/parse_cfg_file_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_functions_parse_cfg_file extends phpbb_test_case
{
public function parse_cfg_file_data()
diff --git a/tests/functions/quoteattr_test.php b/tests/functions/quoteattr_test.php
index 6e191f9610..dbad7a99d8 100644
--- a/tests/functions/quoteattr_test.php
+++ b/tests/functions/quoteattr_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_quoteattr_test extends phpbb_test_case
{
public function quoteattr_test_data()
diff --git a/tests/functions/style_select_test.php b/tests/functions/style_select_test.php
index a918f83155..27f0e68c88 100644
--- a/tests/functions/style_select_test.php
+++ b/tests/functions/style_select_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_functions_style_select_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php
index c224323273..f419c90e9e 100644
--- a/tests/functions/user_delete_test.php
+++ b/tests/functions/user_delete_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
class phpbb_functions_user_delete_test extends phpbb_database_test_case
@@ -28,10 +27,12 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case
{
parent::setUp();
- global $cache, $config, $db, $phpbb_container, $phpbb_dispatcher, $user;
+ global $cache, $config, $db, $phpbb_container, $phpbb_dispatcher, $user, $phpbb_root_path, $phpEx;
$this->db = $db = $this->new_dbal();
- $user = new \phpbb\user('\phpbb\datetime');
+ $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
+ $lang = new \phpbb\language\language($lang_loader);
+ $user = new \phpbb\user($lang, '\phpbb\datetime');
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$phpbb_container = new phpbb_mock_container_builder();
$config = new \phpbb\config\config(array(
@@ -39,8 +40,7 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case
'auth_oauth_google_key' => 'foo',
'auth_oauth_google_secret' => 'bar',
));
- set_config_count('foobar', 0, false, $config);
- $cache = new \phpbb\cache\driver\null();
+ $cache = new \phpbb\cache\driver\dummy();
$request = new phpbb_mock_request();
$notification_manager = new phpbb_mock_notification_manager();
$provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config);
@@ -67,6 +67,7 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case
$request,
$user,
'phpbb_oauth_tokens',
+ 'phpbb_oauth_states',
'phpbb_oauth_accounts',
$oauth_provider_collection,
'phpbb_users',
@@ -81,6 +82,12 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case
$phpbb_container->set('auth.provider.oauth.service.google', $oauth_provider_google);
$phpbb_container->set('auth.provider_collection', $provider_collection);
$phpbb_container->set('notification_manager', $notification_manager);
+
+ $phpbb_container->setParameter('tables.auth_provider_oauth_token_storage', 'phpbb_oauth_tokens');
+ $phpbb_container->setParameter('tables.auth_provider_oauth_states', 'phpbb_oauth_states');
+ $phpbb_container->setParameter('tables.auth_provider_oauth_account_assoc', 'phpbb_oauth_accounts');
+
+ $phpbb_container->setParameter('tables.user_notifications', 'phpbb_user_notifications');
}
public function test_user_delete()
diff --git a/tests/functions/validate_email_test.php b/tests/functions/validate_email_test.php
index b46509fda7..7f8b2679d4 100644
--- a/tests/functions/validate_email_test.php
+++ b/tests/functions/validate_email_test.php
@@ -7,7 +7,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
require_once dirname(__FILE__) . '/../mock/user.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
diff --git a/tests/functions/validate_password_test.php b/tests/functions/validate_password_test.php
index c5942e79bf..5e34c8baba 100644
--- a/tests/functions/validate_password_test.php
+++ b/tests/functions/validate_password_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
diff --git a/tests/functions/validate_string_test.php b/tests/functions/validate_string_test.php
index 24026e4c9f..7aca14c334 100644
--- a/tests/functions/validate_string_test.php
+++ b/tests/functions/validate_string_test.php
@@ -12,7 +12,6 @@
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
class phpbb_functions_validate_string_test extends phpbb_test_case
diff --git a/tests/functions/validate_user_email_test.php b/tests/functions/validate_user_email_test.php
index 951d5794e6..d23ffc0503 100644
--- a/tests/functions/validate_user_email_test.php
+++ b/tests/functions/validate_user_email_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
require_once dirname(__FILE__) . '/../mock/user.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
@@ -29,10 +28,16 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
protected function setUp()
{
+ 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);
}
@@ -48,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()
@@ -59,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')
);
}
diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php
index 4fa5af7ff3..cee5d38400 100644
--- a/tests/functions/validate_username_test.php
+++ b/tests/functions/validate_username_test.php
@@ -11,9 +11,7 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
require_once dirname(__FILE__) . '/../mock/cache.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
@@ -49,6 +47,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case
'foobar_letter_num' => array(),
'foobar_letter_num_sp' => array(),
'foobar_quot' => array('INVALID_CHARS'),
+ 'foobar_emoji' => array('INVALID_EMOJIS'),
'barfoo_disallow' => array('USERNAME_DISALLOWED'),
'admin_taken' => array('USERNAME_TAKEN'),
'group_taken' => array('USERNAME_TAKEN'),
@@ -62,6 +61,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case
'foobar_letter_num' => array(),
'foobar_letter_num_sp' => array('INVALID_CHARS'),
'foobar_quot' => array('INVALID_CHARS'),
+ 'foobar_emoji' => array('INVALID_EMOJIS'),
'barfoo_disallow' => array('USERNAME_DISALLOWED'),
'admin_taken' => array('USERNAME_TAKEN'),
'group_taken' => array('INVALID_CHARS'),
@@ -75,6 +75,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case
'foobar_letter_num' => array(),
'foobar_letter_num_sp' => array('INVALID_CHARS'),
'foobar_quot' => array('INVALID_CHARS'),
+ 'foobar_emoji' => array('INVALID_EMOJIS'),
'barfoo_disallow' => array('USERNAME_DISALLOWED'),
'admin_taken' => array('USERNAME_TAKEN'),
'group_taken' => array('USERNAME_TAKEN'),
@@ -88,6 +89,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case
'foobar_letter_num' => array(),
'foobar_letter_num_sp' => array('INVALID_CHARS'),
'foobar_quot' => array('INVALID_CHARS'),
+ 'foobar_emoji' => array('INVALID_EMOJIS'),
'barfoo_disallow' => array('USERNAME_DISALLOWED'),
'admin_taken' => array('USERNAME_TAKEN'),
'group_taken' => array('INVALID_CHARS'),
@@ -101,6 +103,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case
'foobar_letter_num' => array(),
'foobar_letter_num_sp' => array(),
'foobar_quot' => array('INVALID_CHARS'),
+ 'foobar_emoji' => array('INVALID_EMOJIS'),
'barfoo_disallow' => array('USERNAME_DISALLOWED'),
'admin_taken' => array('USERNAME_TAKEN'),
'group_taken' => array('USERNAME_TAKEN'),
@@ -114,6 +117,7 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case
'foobar_letter_num' => array(),
'foobar_letter_num_sp' => array('INVALID_CHARS'),
'foobar_quot' => array('INVALID_CHARS'),
+ 'foobar_emoji' => array('INVALID_EMOJIS'),
'barfoo_disallow' => array('USERNAME_DISALLOWED'),
'admin_taken' => array('USERNAME_TAKEN'),
'group_taken' => array('USERNAME_TAKEN'),
@@ -175,6 +179,11 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case
'"foobar"',
array('username'),
),
+ 'foobar_emoji' => array(
+ $expected['foobar_emoji'],
+ 'username😮',
+ array('username'),
+ ),
'barfoo_disallow' => array(
$expected['barfoo_disallow'],
'barfoo',