Skip to content

Commit

Permalink
MDL-60600 core_output: Clear static icon system cache between unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Johnson committed Oct 26, 2017
1 parent d12e409 commit a9ca3fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/classes/output/icon_system.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,12 @@ public final function remap_icon_name($iconname, $component) {
}
return false;
}

/**
* Clears the instance cache, for use in unit tests
*/
public static function reset_caches() {
self::$instance = null;
}
}

1 change: 1 addition & 0 deletions lib/phpunit/classes/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ public static function reset_all_data($detectchanges = false) {
core_filetypes::reset_caches();
\core_search\manager::clear_static();
core_user::reset_caches();
\core\output\icon_system::reset_caches();
if (class_exists('core_media_manager', false)) {
core_media_manager::reset_caches();
}
Expand Down

0 comments on commit a9ca3fa

Please sign in to comment.