From 17daaaf441c4972932a4fa3632eaa20132a8763e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gae=CC=88tan=20Muller?= Date: Mon, 12 Jan 2015 22:43:03 +0100 Subject: [ticket/13499] Move `get_remote_file()` to `functions_compatibility.php` PHPBB3-13499 --- tests/functions/get_remote_file_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/functions') diff --git a/tests/functions/get_remote_file_test.php b/tests/functions/get_remote_file_test.php index d412dce164..8e9ad1105a 100644 --- a/tests/functions/get_remote_file_test.php +++ b/tests/functions/get_remote_file_test.php @@ -12,7 +12,7 @@ */ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php'; /** * @group slow -- cgit v1.2.1 From 4bdef6fd21a5dcab455b0cd1ee2652de606929c3 Mon Sep 17 00:00:00 2001 From: MateBartus Date: Thu, 12 Mar 2015 00:25:00 +0100 Subject: [ticket/13697] Moving filesystem related functions to filesystem service * Moving filesystem service to \phpbb\filesystem namespace * Wraping Symfony's Filesystem component * Moving filesystem related functions from includes/functions.php into \phpbb\filesystem\filesystem Functions moved (and deprecated): - phpbb_chmod - phpbb_is_writable - phpbb_is_absolute - phpbb_own_realpath - phpbb_realpath * Adding interface for filesystem service PHPBB3-13697 --- tests/functions/build_url_test.php | 2 +- tests/functions/is_absolute_test.php | 60 ------------------------------------ 2 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 tests/functions/is_absolute_test.php (limited to 'tests/functions') diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php index a59b94c744..3e19b51f02 100644 --- a/tests/functions/build_url_test.php +++ b/tests/functions/build_url_test.php @@ -29,7 +29,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/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 @@ - -* @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)); - } -} -- cgit v1.2.1 From 179a4700221aa49071b07d638c44b9326c7a14a8 Mon Sep 17 00:00:00 2001 From: MateBartus Date: Tue, 14 Apr 2015 02:31:23 +0200 Subject: [ticket/13762] Moving language related functionality into a separate class PHPBB3-13762 --- tests/functions/generate_string_list.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/functions') diff --git a/tests/functions/generate_string_list.php b/tests/functions/generate_string_list.php index cd1e37618a..bcf0c09fe4 100644 --- a/tests/functions/generate_string_list.php +++ b/tests/functions/generate_string_list.php @@ -22,7 +22,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 +41,7 @@ class phpbb_generate_string_list_test extends phpbb_test_case ), array( array('A'), - 'A', + 'A', ), array( array(2 => 'A', 3 => 'B'), -- cgit v1.2.1 From 49f2dd8c5e42265c9b1a21953922644f84752c16 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 4 Jun 2015 19:26:56 +0200 Subject: [ticket/13564] Fix user_delete_test on master PHPBB3-13564 --- tests/functions/user_delete_test.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/functions') diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php index db52dcded7..21561492fd 100644 --- a/tests/functions/user_delete_test.php +++ b/tests/functions/user_delete_test.php @@ -28,10 +28,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 +41,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); -- cgit v1.2.1 From 8ed59fb82a9381914a4ccce91c0c5fac44616556 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 23 Oct 2015 02:44:41 +0200 Subject: [ticket/14250] Change token_storage class to fit changed interface PHPBB3-14250 --- tests/functions/user_delete_test.php | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/functions') diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php index 21561492fd..bd6b53c59f 100644 --- a/tests/functions/user_delete_test.php +++ b/tests/functions/user_delete_test.php @@ -68,6 +68,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', -- cgit v1.2.1 From 14e8113fcf01be7dbdb080458fcbf4e75668cc1a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 31 Mar 2016 11:06:47 -0700 Subject: [ticket/14576] Move common required files to bootstrap PHPBB3-14576 --- tests/functions/build_hidden_fields_for_query_params_test.php | 2 -- tests/functions/build_url_test.php | 2 -- tests/functions/convert_30_dbms_to_31_test.php | 2 -- tests/functions/generate_string_list.php | 3 --- tests/functions/get_formatted_filesize_test.php | 2 -- tests/functions/get_preg_expression_test.php | 2 -- tests/functions/get_remote_file_test.php | 3 --- tests/functions/language_select_test.php | 2 -- tests/functions/make_clickable_email_test.php | 3 --- tests/functions/make_clickable_test.php | 3 --- tests/functions/obtain_online_test.php | 3 --- tests/functions/parse_cfg_file_test.php | 2 -- tests/functions/quoteattr_test.php | 2 -- tests/functions/style_select_test.php | 2 -- tests/functions/user_delete_test.php | 1 - tests/functions/validate_email_test.php | 1 - tests/functions/validate_password_test.php | 1 - tests/functions/validate_string_test.php | 1 - tests/functions/validate_user_email_test.php | 1 - tests/functions/validate_username_test.php | 2 -- 20 files changed, 40 deletions(-) (limited to 'tests/functions') 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 3e19b51f02..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() diff --git a/tests/functions/convert_30_dbms_to_31_test.php b/tests/functions/convert_30_dbms_to_31_test.php index 729c0a82f0..1405d81eb3 100644 --- a/tests/functions/convert_30_dbms_to_31_test.php +++ b/tests/functions/convert_30_dbms_to_31_test.php @@ -11,8 +11,6 @@ * */ -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() diff --git a/tests/functions/generate_string_list.php b/tests/functions/generate_string_list.php index bcf0c09fe4..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; 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 781a73a462..1550aa37e6 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_compatibility.php'; - /** * @group slow */ 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..f32b4339a8 100644 --- a/tests/functions/make_clickable_email_test.php +++ b/tests/functions/make_clickable_email_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_email_test extends phpbb_test_case { protected function setUp() diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php index 63beeb06b2..48fc2c19fb 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 { /** 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 bd6b53c59f..480b5fc5e1 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 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..8dcec88103 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'; diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php index 4fa5af7ff3..d310f58036 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'; -- cgit v1.2.1 From c64b8102b7c5dc5bd0be9d8085d01a66e90dde73 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Tue, 29 Mar 2016 21:21:35 +0200 Subject: [ticket/10809] Remove MSSQL support PHPBB3-10809 --- tests/functions/convert_30_dbms_to_31_test.php | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/functions') diff --git a/tests/functions/convert_30_dbms_to_31_test.php b/tests/functions/convert_30_dbms_to_31_test.php index 1405d81eb3..e46a569565 100644 --- a/tests/functions/convert_30_dbms_to_31_test.php +++ b/tests/functions/convert_30_dbms_to_31_test.php @@ -16,7 +16,6 @@ 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'), -- cgit v1.2.1 From e974f338afb86c065e9b160363bc2e6156f8566d Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Sun, 13 Nov 2016 18:08:35 +0100 Subject: [ticket/14739] Remove SQLite 2.8.x database driver PHPBB3-14739 --- tests/functions/convert_30_dbms_to_31_test.php | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/functions') diff --git a/tests/functions/convert_30_dbms_to_31_test.php b/tests/functions/convert_30_dbms_to_31_test.php index e46a569565..456eb64461 100644 --- a/tests/functions/convert_30_dbms_to_31_test.php +++ b/tests/functions/convert_30_dbms_to_31_test.php @@ -22,7 +22,6 @@ class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case array('mysqli'), array('oracle'), array('postgres'), - array('sqlite'), ); } -- cgit v1.2.1 From 0aba1faa0803af6013c9ac2071e87f117e9c4835 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 26 Jul 2017 21:14:05 +0200 Subject: [ticket/security/211] Do not match javascript URIs with URL regexes SECURITY-211 --- tests/functions/make_clickable_test.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/functions') diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php index 63beeb06b2..2cdefe689d 100644 --- a/tests/functions/make_clickable_test.php +++ b/tests/functions/make_clickable_test.php @@ -55,6 +55,10 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case 'http://testhost/viewtopic.php?t=1', 'viewtopic.php?t=1' ), + array( + 'javascript://testhost/viewtopic.php?t=1', + 'javascript://testhost/viewtopic.php?t=1' + ), array( 'email@domain.com', 'email@domain.com' @@ -92,6 +96,10 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case 'ftp://ftp.täst.de/', 'ftp://ftp.täst.de/' ), + array( + 'javascript://täst.de/', + 'javascript://täst.de/' + ), array( 'sip://bantu@täst.de', 'sip://bantu@täst.de' -- cgit v1.2.1 From f7d387f93c421e93ef13375bd5e0fb408e921598 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 27 Jul 2017 18:23:43 +0200 Subject: [ticket/security/211] Add test for line breaks in URL SECURITY-211 --- tests/functions/make_clickable_test.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/functions') diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php index 2cdefe689d..2bb7721d21 100644 --- a/tests/functions/make_clickable_test.php +++ b/tests/functions/make_clickable_test.php @@ -59,6 +59,10 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case 'javascript://testhost/viewtopic.php?t=1', 'javascript://testhost/viewtopic.php?t=1' ), + array( + "java\nscri\npt://testhost/viewtopic.php?t=1", + "java\nscri\npt://testhost/viewtopic.php?t=1" + ), array( 'email@domain.com', 'email@domain.com' -- cgit v1.2.1 From f6b8f69e7ec51841785bc598a5e0533d946c1def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sun, 10 Sep 2017 11:19:40 +0200 Subject: [ticket/15172] Add symfony_request to some tests PHPBB3-15172 --- tests/functions/make_clickable_email_test.php | 5 +++-- tests/functions/make_clickable_test.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'tests/functions') diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php index f32b4339a8..d481bde80d 100644 --- a/tests/functions/make_clickable_email_test.php +++ b/tests/functions/make_clickable_email_test.php @@ -17,9 +17,10 @@ class phpbb_functions_make_clickable_email_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); } /** @@ -168,7 +169,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case array('abc,def@example.com'), // invalid character , array('abcdef@example.com', 'abc>def@example.com'), // 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 48fc2c19fb..a351a6d527 100644 --- a/tests/functions/make_clickable_test.php +++ b/tests/functions/make_clickable_test.php @@ -146,9 +146,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); } /** -- cgit v1.2.1 From f8fbe3793680af1dae2db2829cfc84068831c52f Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 28 Jun 2017 00:58:03 +0700 Subject: [ticket/14972] replace all occurrences of sizeof() with the count() PHPBB3-14972 --- tests/functions/get_remote_file_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/functions') diff --git a/tests/functions/get_remote_file_test.php b/tests/functions/get_remote_file_test.php index 1550aa37e6..75e5a6dc61 100644 --- a/tests/functions/get_remote_file_test.php +++ b/tests/functions/get_remote_file_test.php @@ -58,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.' ); -- cgit v1.2.1 From 400fc0f73d03010d3bf28d2b1db5d789dc085334 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 25 Dec 2017 18:49:31 +0100 Subject: [ticket/15055] Only drop dependent PK indexes and fix more tests for mssql PHPBB3-15055 --- tests/functions/fixtures/validate_username.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/functions') 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 @@ + group_idgroup_namegroup_desc + 10 foobar_group test123 -- cgit v1.2.1 From 0f10c6ff6f0537c9cb00f6007b6bee9944e6587a Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Thu, 6 Sep 2018 14:31:57 +0200 Subject: [ticket/15716] Remove OAuth data upon user deletion PHPBB3-15716 --- tests/functions/user_delete_test.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/functions') diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php index db9b6e0c90..88680d5719 100644 --- a/tests/functions/user_delete_test.php +++ b/tests/functions/user_delete_test.php @@ -82,6 +82,10 @@ 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'); } public function test_user_delete() -- cgit v1.2.1 From e315ea90b8f0d5763cd657090cadc99f221e8b44 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sat, 23 Feb 2019 01:56:03 +0100 Subject: [ticket/15975] Remove user notification data upon user deletion PHPBB3-15975 --- tests/functions/user_delete_test.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/functions') diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php index 88680d5719..f419c90e9e 100644 --- a/tests/functions/user_delete_test.php +++ b/tests/functions/user_delete_test.php @@ -86,6 +86,8 @@ class phpbb_functions_user_delete_test extends phpbb_database_test_case $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() -- cgit v1.2.1 From 7160c67b2ca8fa1c819d5da3e629fb02621a7066 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Mon, 1 Apr 2019 23:12:55 +0200 Subject: [ticket/16004] Add tests/functions/validate_username_test.php PHPBB3-16004 --- tests/functions/validate_username_test.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/functions') diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php index d310f58036..cee5d38400 100644 --- a/tests/functions/validate_username_test.php +++ b/tests/functions/validate_username_test.php @@ -47,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'), @@ -60,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'), @@ -73,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'), @@ -86,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'), @@ -99,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'), @@ -112,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'), @@ -173,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', -- cgit v1.2.1 From cf898133a4fa0c412911a9b65a533c84524edc34 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 7 Sep 2019 13:24:20 +0200 Subject: [ticket/16123] Add tests to cover different ban reasons PHPBB3-16123 --- tests/functions/fixtures/validate_email.xml | 21 +++++++++++++++++++++ tests/functions/validate_user_email_test.php | 10 +++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) (limited to 'tests/functions') diff --git a/tests/functions/fixtures/validate_email.xml b/tests/functions/fixtures/validate_email.xml index eb4fd90217..5a21e51d13 100644 --- a/tests/functions/fixtures/validate_email.xml +++ b/tests/functions/fixtures/validate_email.xml @@ -1,5 +1,26 @@ +
+ ban_userid + ban_exclude + ban_end + ban_email + ban_give_reason + + 0 + 0 + 0 + banned@example.com + + + + 0 + 0 + 0 + banned2@example.com + just because + +
user_idusername diff --git a/tests/functions/validate_user_email_test.php b/tests/functions/validate_user_email_test.php index 8dcec88103..f64d01517c 100644 --- a/tests/functions/validate_user_email_test.php +++ b/tests/functions/validate_user_email_test.php @@ -28,10 +28,14 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case protected function setUp() { + global $phpbb_dispatcher, $phpbb_root_path, $phpEx; + parent::setUp(); $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 +51,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 +61,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') ); } -- cgit v1.2.1 From d186df8cb40f5375ae7143fb432cb36cafe7d0a1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 7 Sep 2019 21:57:38 +0200 Subject: [ticket/16123] Purge cache to ensure up to date ban list in tests PHPBB3-16123 --- tests/functions/validate_user_email_test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/functions') diff --git a/tests/functions/validate_user_email_test.php b/tests/functions/validate_user_email_test.php index f64d01517c..d23ffc0503 100644 --- a/tests/functions/validate_user_email_test.php +++ b/tests/functions/validate_user_email_test.php @@ -28,10 +28,12 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case protected function setUp() { - global $phpbb_dispatcher, $phpbb_root_path, $phpEx; + global $cache, $phpbb_dispatcher, $phpbb_root_path, $phpEx; parent::setUp(); + $cache = new \phpbb\cache\driver\file(); + $cache->purge(); $this->db = $this->new_dbal(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $language = new phpbb\language\language(new phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); -- cgit v1.2.1 From 4abdfd1709d1c39362656de70f95d762e3f031f8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 8 Sep 2019 09:40:56 +0200 Subject: [ticket/16123] Specify ban_id in validate email fixture PHPBB3-16123 --- tests/functions/fixtures/validate_email.xml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/functions') diff --git a/tests/functions/fixtures/validate_email.xml b/tests/functions/fixtures/validate_email.xml index 5a21e51d13..fa139f6f18 100644 --- a/tests/functions/fixtures/validate_email.xml +++ b/tests/functions/fixtures/validate_email.xml @@ -1,12 +1,14 @@
+ ban_idban_useridban_excludeban_endban_emailban_give_reason + 1 0 0 0 @@ -14,6 +16,7 @@ + 2 0 0 0 -- cgit v1.2.1