MDL-52605 phpunit: Improve get_message_processors reset

This commit is contained in:
Mark Nielsen
2016-01-04 07:52:49 +08:00
committed by Rajesh Taneja
parent 7de2aa1a95
commit f3008d2a08
3 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -207,7 +207,7 @@ class phpunit_util extends testing_util {
reset_text_filters_cache(true);
events_get_handlers('reset');
core_text::reset_caches();
get_message_processors(false, true);
get_message_processors(false, true, true);
filter_manager::reset_caches();
core_filetypes::reset_caches();
+6 -1
View File
@@ -2571,14 +2571,19 @@ function message_mark_message_read($message, $timeread, $messageworkingempty=fal
*
* @param bool $ready only return ready-to-use processors
* @param bool $reset Reset list of message processors (used in unit tests)
* @param bool $resetonly Just reset, then exit
* @return mixed $processors array of objects containing information on message processors
*/
function get_message_processors($ready = false, $reset = false) {
function get_message_processors($ready = false, $reset = false, $resetonly = false) {
global $DB, $CFG;
static $processors;
if ($reset) {
$processors = array();
if ($resetonly) {
return $processors;
}
}
if (empty($processors)) {
+3
View File
@@ -1,6 +1,9 @@
This files describes API changes in /message/ messaging system,
information provided here is intended especially for developers.
=== 3.1 ===
* get_message_processors accepts an addition parameter for testing, which will just reset processor and exit.
=== 2.9 ===
* Renderer method \core_message_renderer::manage_messagingoptions now accepts a user id parameter as well.