From 78abbf72b009bc103c5b39e8765f2d95496157ed Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 14 Feb 2019 08:40:21 +0100 Subject: Make TestCase->overwriteService() work with App classes Signed-off-by: Joas Schilling --- lib/private/ServerContainer.php | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- cgit v1.2.3