From 9a3d33107b6aa71eb472721626971c466cc23219 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Thu, 15 Mar 2018 15:36:47 -0700 Subject: [PATCH] Add cleanup for handlers cache. This is useful if we want to override certain handler for testing but have no way to remove it from cache otherwise. Change-Id: Icb4f9360c6e7684d15e91a7009a5a3a3e2febb37 --- includes/content/ContentHandler.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index eab3afb966..3cfac8f90b 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -332,6 +332,13 @@ abstract class ContentHandler { return self::$handlers[$modelId]; } + /** + * Clean up handlers cache. + */ + public static function cleanupHandlersCache() { + self::$handlers = []; + } + /** * Returns the localized name for a given content model. * -- 2.20.1