summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-12-19 20:18:09 +0100
committerVincent Petry <pvince81@owncloud.com>2013-12-19 20:18:09 +0100
commit1c340444a43d76c388153059aefd24276d8347a9 (patch)
tree5ce6a7c7c9feeb9cf6e1e793d7d742af709ed5be /lib
parent526e8730733f1ac1be76deacf2e45fba37f6fbb8 (diff)
downloadnextcloud-server-1c340444a43d76c388153059aefd24276d8347a9.tar.gz
nextcloud-server-1c340444a43d76c388153059aefd24276d8347a9.zip
Added test cleanup listener to detect untidy tests
After each test suite, detects whether there are stray datafiles, hooks or proxies, then show a warning and clear them.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/fileproxy.php6
-rw-r--r--lib/private/hook.php8
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/private/fileproxy.php b/lib/private/fileproxy.php
index 52ec79b4bdb..2997aaf81b6 100644
--- a/lib/private/fileproxy.php
+++ b/lib/private/fileproxy.php
@@ -67,7 +67,11 @@ class OC_FileProxy{
self::$proxies[]=$proxy;
}
- public static function getProxies($operation) {
+ public static function getProxies($operation = null) {
+ if ($operation === null) {
+ // return all
+ return self::$proxies;
+ }
$proxies=array();
foreach(self::$proxies as $proxy) {
if(method_exists($proxy, $operation)) {
diff --git a/lib/private/hook.php b/lib/private/hook.php
index 8516cf0dcff..b63b442c31b 100644
--- a/lib/private/hook.php
+++ b/lib/private/hook.php
@@ -97,4 +97,12 @@ class OC_Hook{
self::$registered=array();
}
}
+
+ /**
+ * DO NOT USE!
+ * For unit tests ONLY!
+ */
+ static public function getHooks() {
+ return self::$registered;
+ }
}