diff options
-rw-r--r-- | phpBB/assets/javascript/core.js | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 1 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 1 | ||||
-rw-r--r-- | phpBB/language/en/acp/board.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/common.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/auth/provider/oauth/oauth.php | 16 | ||||
-rw-r--r-- | phpBB/phpbb/avatar/driver/upload.php | 3 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/driver.php | 7 | ||||
-rw-r--r-- | phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php | 36 | ||||
-rw-r--r-- | phpBB/phpbb/report/report_handler_pm.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/report/report_handler_post.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/search/fulltext_mysql.php | 28 | ||||
-rw-r--r-- | phpBB/phpbb/search/fulltext_native.php | 32 | ||||
-rw-r--r-- | phpBB/phpbb/search/fulltext_postgres.php | 28 | ||||
-rw-r--r-- | phpBB/phpbb/search/fulltext_sphinx.php | 22 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/ucp_pm_viewmessage.html | 8 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/viewtopic_body.html | 10 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 18 | ||||
-rw-r--r-- | tests/RUNNING_TESTS.md | 25 |
19 files changed, 227 insertions, 24 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 7f6f3db93b..bd1925baf6 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1656,7 +1656,7 @@ $(function() { phpbb.registerPageDropdowns(); - $('#color_palette_placeholder').each(function() { + $('[data-orientation]').each(function() { phpbb.registerPalette($(this)); }); diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index c2a004c395..f89f5535eb 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -356,6 +356,7 @@ class acp_board 'load_user_activity_limit' => array('lang' => 'LOAD_USER_ACTIVITY_LIMIT', 'validate' => 'int:0:99999999', 'type' => 'number:0:99999999', 'explain' => true), 'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_cdn' => array('lang' => 'ALLOW_CDN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'enable_accurate_pm_button' => array('lang' => 'YES_ACCURATE_PM_BUTTON', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_live_searches' => array('lang' => 'ALLOW_LIVE_SEARCHES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend3' => 'CUSTOM_PROFILE_FIELDS', diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 1f92439c70..4dfe5e94aa 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -106,6 +106,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1' INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_force_sender', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_size', '50'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_accurate_pm_button', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_mod_rewrite', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_board_notifications', '1'); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index b050af070a..25b656499c 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -406,6 +406,8 @@ $lang = array_merge($lang, array( 'RECOMPILE_STYLES_EXPLAIN' => 'Check for updated style components on filesystem and recompile.', 'YES_ANON_READ_MARKING' => 'Enable topic marking for guests', 'YES_ANON_READ_MARKING_EXPLAIN' => 'Stores read/unread status information for guests. If disabled, posts are always marked read for guests.', + 'YES_ACCURATE_PM_BUTTON' => 'Enable accurate PM indicator in topic pages', + 'YES_ACCURATE_PM_BUTTON_EXPLAIN' => 'If this setting is enabled, only users who are permitted to read private messages will have a private message button.', 'YES_BIRTHDAYS' => 'Enable birthday listing', 'YES_BIRTHDAYS_EXPLAIN' => 'If disabled the birthday listing is no longer displayed. To let this setting take effect the birthday feature needs to be enabled too.', 'YES_JUMPBOX' => 'Enable display of jumpbox', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index d7a1ce8e71..5140919dad 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -138,8 +138,10 @@ $lang = array_merge($lang, array( 1 => 'Users browsing this forum: %2$s and %1$d guest', 2 => 'Users browsing this forum: %2$s and %1$d guests', ), + 'BUTTON_DELETE' => 'Delete', 'BUTTON_EDIT' => 'Edit', 'BUTTON_FORUM_LOCKED' => 'Locked', + 'BUTTON_INFORMATION' => 'Information', 'BUTTON_NEW_TOPIC' => 'New Topic', 'BUTTON_PM' => 'PM', 'BUTTON_PM_FORWARD' => 'Forward', @@ -148,7 +150,9 @@ $lang = array_merge($lang, array( 'BUTTON_PM_REPLY_ALL' => 'Reply All', 'BUTTON_POST_REPLY' => 'Post Reply', 'BUTTON_QUOTE' => 'Quote', + 'BUTTON_REPORT' => 'Report', 'BUTTON_TOPIC_LOCKED' => 'Locked', + 'BUTTON_WARN' => 'Warn', 'BYTES' => 'Bytes', 'BYTES_SHORT' => 'B', diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 5587e69d3c..8809a0c6b4 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -227,6 +227,22 @@ class oauth extends \phpbb\auth\provider\base $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); + /** + * Event is triggered before check if provider is already associated with an account + * + * @event core.oauth_login_after_check_if_provider_id_has_match + * @var array row User row + * @var array data Provider data + * @var \OAuth\Common\Service\ServiceInterface service OAuth service + * @since 3.2.3-RC1 + */ + $vars = array( + 'row', + 'data', + 'service', + ); + extract($this->dispatcher->trigger_event('core.oauth_login_after_check_if_provider_id_has_match', compact($vars))); + if (!$row) { // The user does not yet exist, ask to link or create profile diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index d765a27871..77b44754ac 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -203,15 +203,18 @@ class upload extends \phpbb\avatar\driver\driver * * @event core.avatar_driver_upload_move_file_before * @var array filedata Array containing uploaded file data + * @var \phpbb\files\filespec file Instance of filespec class * @var string destination Destination directory where the file is going to be moved * @var string prefix Prefix for the avatar filename * @var array row Array with avatar row data * @var array error Array of errors, if filled in by this event file will not be moved * @since 3.1.6-RC1 * @changed 3.1.9-RC1 Added filedata + * @changed 3.2.3-RC1 Added file */ $vars = array( 'filedata', + 'file', 'destination', 'prefix', 'row', diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 5851469806..a36ce8c0d7 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -903,9 +903,10 @@ abstract class driver implements driver_interface // Subquery with {left hand} {operator} {compare kind} {SELECT Kind } {Sub Query} - $condition = $condition[self::LEFT_STMT] . ' ' . $condition[self::COMPARE_OP] . ' ' . $condition[self::SUBQUERY_OP] . ' ( '; - $condition .= $this->sql_build_query($condition[self::SUBQUERY_SELECT_TYPE], $condition[self::SUBQUERY_BUILD]); - $condition .= ' )'; + $result = $condition[self::LEFT_STMT] . ' ' . $condition[self::COMPARE_OP] . ' ' . $condition[self::SUBQUERY_OP] . ' ( '; + $result .= $this->sql_build_query($condition[self::SUBQUERY_SELECT_TYPE], $condition[self::SUBQUERY_BUILD]); + $result .= ' )'; + $condition = $result; break; diff --git a/phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php b/phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php new file mode 100644 index 0000000000..a7b99606f7 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php @@ -0,0 +1,36 @@ +<?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. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class enable_accurate_pm_button extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v322', + ); + } + + public function effectively_installed() + { + return isset($this->config['enable_accurate_pm_button']); + } + + public function update_data() + { + return array( + array('config.add', array('enable_accurate_pm_button', '1')), + ); + } +} diff --git a/phpBB/phpbb/report/report_handler_pm.php b/phpBB/phpbb/report/report_handler_pm.php index 2f2a697efc..774ca329ad 100644 --- a/phpBB/phpbb/report/report_handler_pm.php +++ b/phpBB/phpbb/report/report_handler_pm.php @@ -53,8 +53,8 @@ class report_handler_pm extends report_handler 'user_notify' => $user_notify, 'report_text' => $report_text, 'reported_post_text' => $this->report_data['message_text'], - 'reported_post_uid' => $this->report_data['bbcode_bitfield'], - 'reported_post_bitfield' => $this->report_data['bbcode_uid'], + 'reported_post_uid' => $this->report_data['bbcode_uid'], + 'reported_post_bitfield' => $this->report_data['bbcode_bitfield'], 'reported_post_enable_bbcode' => $this->report_data['enable_bbcode'], 'reported_post_enable_smilies' => $this->report_data['enable_smilies'], 'reported_post_enable_magic_url' => $this->report_data['enable_magic_url'], diff --git a/phpBB/phpbb/report/report_handler_post.php b/phpBB/phpbb/report/report_handler_post.php index 5574a16dc0..52f09683ce 100644 --- a/phpBB/phpbb/report/report_handler_post.php +++ b/phpBB/phpbb/report/report_handler_post.php @@ -59,8 +59,8 @@ class report_handler_post extends report_handler 'user_notify' => $user_notify, 'report_text' => $report_text, 'reported_post_text' => $this->report_data['post_text'], - 'reported_post_uid' => $this->report_data['bbcode_bitfield'], - 'reported_post_bitfield' => $this->report_data['bbcode_uid'], + 'reported_post_uid' => $this->report_data['bbcode_uid'], + 'reported_post_bitfield' => $this->report_data['bbcode_bitfield'], 'reported_post_enable_bbcode' => $this->report_data['enable_bbcode'], 'reported_post_enable_smilies' => $this->report_data['enable_smilies'], 'reported_post_enable_magic_url' => $this->report_data['enable_magic_url'], diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php index 51c5fe8b76..cc8180ec69 100644 --- a/phpBB/phpbb/search/fulltext_mysql.php +++ b/phpBB/phpbb/search/fulltext_mysql.php @@ -918,6 +918,34 @@ class fulltext_mysql extends \phpbb\search\base $words = array_unique(array_merge($split_text, $split_title)); + /** + * Event to modify method arguments and words before the MySQL search index is updated + * + * @event core.search_mysql_index_before + * @var string mode Contains the post mode: edit, post, reply, quote + * @var int post_id The id of the post which is modified/created + * @var string message New or updated post content + * @var string subject New or updated post subject + * @var int poster_id Post author's user id + * @var int forum_id The id of the forum in which the post is located + * @var array words List of words added to the index + * @var array split_text Array of words from the message + * @var array split_title Array of words from the title + * @since 3.2.3-RC1 + */ + $vars = array( + 'mode', + 'post_id', + 'message', + 'subject', + 'poster_id', + 'forum_id', + 'words', + 'split_text', + 'split_title', + ); + extract($this->phpbb_dispatcher->trigger_event('core.search_mysql_index_before', compact($vars))); + unset($split_text); unset($split_title); diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index bd222488a0..eb972a257a 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -1433,6 +1433,38 @@ class fulltext_native extends \phpbb\search\base $words['del']['post'] = array(); $words['del']['title'] = array(); } + + /** + * Event to modify method arguments and words before the native search index is updated + * + * @event core.search_native_index_before + * @var string mode Contains the post mode: edit, post, reply, quote + * @var int post_id The id of the post which is modified/created + * @var string message New or updated post content + * @var string subject New or updated post subject + * @var int poster_id Post author's user id + * @var int forum_id The id of the forum in which the post is located + * @var array words Grouped lists of words added to or remove from the index + * @var array split_text Array of words from the message + * @var array split_title Array of words from the title + * @var array cur_words Array of words currently in the index for comparing to new words + * when mode is edit. Empty for other modes. + * @since 3.2.3-RC1 + */ + $vars = array( + 'mode', + 'post_id', + 'message', + 'subject', + 'poster_id', + 'forum_id', + 'words', + 'split_text', + 'split_title', + 'cur_words', + ); + extract($this->phpbb_dispatcher->trigger_event('core.search_native_index_before', compact($vars))); + unset($split_text); unset($split_title); diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index 6443342057..ac76f2f87a 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -889,6 +889,34 @@ class fulltext_postgres extends \phpbb\search\base $words = array_unique(array_merge($split_text, $split_title)); + /** + * Event to modify method arguments and words before the PostgreSQL search index is updated + * + * @event core.search_postgres_index_before + * @var string mode Contains the post mode: edit, post, reply, quote + * @var int post_id The id of the post which is modified/created + * @var string message New or updated post content + * @var string subject New or updated post subject + * @var int poster_id Post author's user id + * @var int forum_id The id of the forum in which the post is located + * @var array words Array of words added to the index + * @var array split_text Array of words from the message + * @var array split_title Array of words from the title + * @since 3.2.3-RC1 + */ + $vars = array( + 'mode', + 'post_id', + 'message', + 'subject', + 'poster_id', + 'forum_id', + 'words', + 'split_text', + 'split_title', + ); + extract($this->phpbb_dispatcher->trigger_event('core.search_postgres_index_before', compact($vars))); + unset($split_text); unset($split_title); diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index 54d32ca371..e2eeb5f7f3 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -758,6 +758,28 @@ class fulltext_sphinx */ public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { + /** + * Event to modify method arguments before the Sphinx search index is updated + * + * @event core.search_sphinx_index_before + * @var string mode Contains the post mode: edit, post, reply, quote + * @var int post_id The id of the post which is modified/created + * @var string message New or updated post content + * @var string subject New or updated post subject + * @var int poster_id Post author's user id + * @var int forum_id The id of the forum in which the post is located + * @since 3.2.3-RC1 + */ + $vars = array( + 'mode', + 'post_id', + 'message', + 'subject', + 'poster_id', + 'forum_id', + ); + extract($this->phpbb_dispatcher->trigger_event('core.search_sphinx_index_before', compact($vars))); + if ($mode == 'edit') { $this->sphinx->UpdateAttributes($this->indexes, array('forum_id', 'poster_id'), array((int) $post_id => array((int) $forum_id, (int) $poster_id))); diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index 4295867c05..2ed0189c21 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -91,28 +91,28 @@ <!-- IF U_EDIT --> <li> <a href="{U_EDIT}" title="{L_POST_EDIT_PM}" class="button button-icon-only"> - <i class="icon fa-pencil fa-fw" aria-hidden="true"></i><span class="sr-only">{L_POST_EDIT_PM}</span> + <i class="icon fa-pencil fa-fw" aria-hidden="true"></i><span class="sr-only">{L_BUTTON_EDIT}</span> </a> </li> <!-- ENDIF --> <!-- IF U_DELETE --> <li> <a href="{U_DELETE}" title="{L_DELETE_MESSAGE}" class="button button-icon-only"> - <i class="icon fa-times fa-fw" aria-hidden="true"></i><span class="sr-only">{L_DELETE_MESSAGE}</span> + <i class="icon fa-times fa-fw" aria-hidden="true"></i><span class="sr-only">{L_BUTTON_DELETE}</span> </a> </li> <!-- ENDIF --> <!-- IF U_REPORT --> <li> <a href="{U_REPORT}" title="{L_REPORT_PM}" class="button button-icon-only"> - <i class="icon fa-exclamation fa-fw" aria-hidden="true"></i><span class="sr-only">{L_REPORT_PM}</span> + <i class="icon fa-exclamation fa-fw" aria-hidden="true"></i><span class="sr-only">{L_BUTTON_REPORT}</span> </a> </li> <!-- ENDIF --> <!-- IF U_QUOTE --> <li> <a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}" class="button button-icon-only"> - <i class="icon fa-quote-left fa-fw" aria-hidden="true"></i><span class="sr-only">{L_POST_QUOTE_PM}</span> + <i class="icon fa-quote-left fa-fw" aria-hidden="true"></i><span class="sr-only">{L_BUTTON_QUOTE}</span> </a> </li> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 40249f24eb..a9136e1810 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -242,35 +242,35 @@ <!-- IF postrow.U_DELETE --> <li> <a href="{postrow.U_DELETE}" title="{L_DELETE_POST}" class="button button-icon-only"> - <i class="icon fa-times fa-fw" aria-hidden="true"></i><span class="sr-only">{L_DELETE_POST}</span> + <i class="icon fa-times fa-fw" aria-hidden="true"></i><span class="sr-only">{L_BUTTON_DELETE}</span> </a> </li> <!-- ENDIF --> <!-- IF postrow.U_REPORT --> <li> <a href="{postrow.U_REPORT}" title="{L_REPORT_POST}" class="button button-icon-only"> - <i class="icon fa-exclamation fa-fw" aria-hidden="true"></i><span class="sr-only">{L_REPORT_POST}</span> + <i class="icon fa-exclamation fa-fw" aria-hidden="true"></i><span class="sr-only">{L_BUTTON_REPORT}</span> </a> </li> <!-- ENDIF --> <!-- IF postrow.U_WARN --> <li> <a href="{postrow.U_WARN}" title="{L_WARN_USER}" class="button button-icon-only"> - <i class="icon fa-exclamation-triangle fa-fw" aria-hidden="true"></i><span class="sr-only">{L_WARN_USER}</span> + <i class="icon fa-exclamation-triangle fa-fw" aria-hidden="true"></i><span class="sr-only">{L_BUTTON_WARN}</span> </a> </li> <!-- ENDIF --> <!-- IF postrow.U_INFO --> <li> <a href="{postrow.U_INFO}" title="{L_INFORMATION}" class="button button-icon-only"> - <i class="icon fa-info fa-fw" aria-hidden="true"></i><span class="sr-only">{L_INFORMATION}</span> + <i class="icon fa-info fa-fw" aria-hidden="true"></i><span class="sr-only">{L_BUTTON_INFORMATION}</span> </a> </li> <!-- ENDIF --> <!-- IF postrow.U_QUOTE --> <li> <a href="{postrow.U_QUOTE}" title="{L_REPLY_WITH_QUOTE}" class="button button-icon-only"> - <i class="icon fa-quote-left fa-fw" aria-hidden="true"></i><span class="sr-only">{L_QUOTE}</span> + <i class="icon fa-quote-left fa-fw" aria-hidden="true"></i><span class="sr-only">{L_BUTTON_QUOTE}</span> </a> </li> <!-- ENDIF --> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 155dca7788..3c25c3b037 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1576,12 +1576,20 @@ if (count($attach_list)) } } -// Get the list of users who can receive private messages -$can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm'); -$can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm']; +if ($config['enable_accurate_pm_button']) +{ + // Get the list of users who can receive private messages + $can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm'); + $can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm']; -// Get the list of permanently banned users -$permanently_banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false); + // Get the list of permanently banned users + $permanently_banned_users = phpbb_get_banned_user_ids(array_keys($user_cache), false); +} +else +{ + $can_receive_pm_list = array_keys($user_cache); + $permanently_banned_users = []; +} $i_total = count($rowset) - 1; $prev_post_id = ''; diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md index c9941d61e5..12ae7fa687 100644 --- a/tests/RUNNING_TESTS.md +++ b/tests/RUNNING_TESTS.md @@ -143,14 +143,14 @@ If you want all tests, run: Functional tests ------------------ +================ Functional tests test software the way a user would. They simulate a user browsing the website, but they do these steps in an automated way. phpBB allows you to write such tests. Running -======= +------- Running the tests requires your phpBB3 repository to be accessible through a local web server. You will need to supply the URL to the webserver in @@ -170,6 +170,27 @@ If you only want the functional tests, run: This will change your board's config.php file, but it makes a backup at config_dev.php, so you can restore it after the test run is complete. +UI tests +======== + +UI tests are functional tests that also support running JavaScript in a +headless browser. These should be used when functionality that is only +executed using JS needs to be tested. They require a running +[PhantomJS WebDriver instance](http://phantomjs.org/). The executable can +either be downloaded from [PhantomJS](http://phantomjs.org/download.html) +or alternatively be installed with npm: + + $ npm install -g phantomjs-prebuilt + +You might have to run the command as superuser / administrator on some +systems. Afterwards, a new WebDriver instance can be started via command +line: + + $ phantomjs --webdriver=127.0.0.1:8910 + +Port 8910 is the default port that will be used by UI tests to connect +to the WebDriver instance. + More Information ================ |