Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-10-11 00:25:12 +0400
committermattab <matthieu.aubry@gmail.com>2013-10-11 00:25:12 +0400
commit7da0007856df9b35891e484c9320a37749041ff3 (patch)
tree56aab70db83533b1284b3d05fca8ae3b5433a10b /core/Singleton.php
parent401597b12baeabf89324a0564362c59a3c9e93ee (diff)
Refs #4208 refactor some singletons
Diffstat (limited to 'core/Singleton.php')
-rw-r--r--core/Singleton.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/Singleton.php b/core/Singleton.php
index 7e7679c67a..73bbd26196 100644
--- a/core/Singleton.php
+++ b/core/Singleton.php
@@ -34,4 +34,13 @@ class Singleton
$class = get_called_class();
unset(self::$instances[$class]);
}
+
+ /**
+ * Sets the singleton instance. For testing purposes.
+ */
+ public static function setSingletonInstance($instance)
+ {
+ $class = get_called_class();
+ self::$instances[$class] = $instance;
+ }
}