summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-02-14 08:40:21 +0100
committerJoas Schilling <coding@schilljs.com>2019-02-14 08:40:21 +0100
commit78abbf72b009bc103c5b39e8765f2d95496157ed (patch)
treee4ddd7eb1937aeb7313225c2a247e599f24b0c46 /lib
parent4d8c42a4fb8bbebfce4a9abd431f7600e0465fe0 (diff)
downloadnextcloud-server-78abbf72b009bc103c5b39e8765f2d95496157ed.tar.gz
nextcloud-server-78abbf72b009bc103c5b39e8765f2d95496157ed.zip
Make TestCase->overwriteService() work with App classes
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/ServerContainer.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/ServerContainer.php b/lib/private/ServerContainer.php
index 40e261df4d6..e1447d2f06b 100644
--- a/lib/private/ServerContainer.php
+++ b/lib/private/ServerContainer.php
@@ -107,6 +107,10 @@ class ServerContainer extends SimpleContainer {
public function query($name) {
$name = $this->sanitizeName($name);
+ if (isset($this[$name])) {
+ return $this[$name];
+ }
+
// In case the service starts with OCA\ we try to find the service in
// the apps container first.
if (strpos($name, 'OCA\\') === 0 && substr_count($name, '\\') >= 2) {