Merge pull request #14191 from nextcloud/bugfix/noid/make-testcase-overwrite-service-work-with-app-classes
Make TestCase->overwriteService() work with App classes
This commit is contained in:
commit
f3dc0d32db
|
@ -107,6 +107,10 @@ class ServerContainer extends SimpleContainer {
|
||||||
public function query($name) {
|
public function query($name) {
|
||||||
$name = $this->sanitizeName($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
|
// In case the service starts with OCA\ we try to find the service in
|
||||||
// the apps container first.
|
// the apps container first.
|
||||||
if (strpos($name, 'OCA\\') === 0 && substr_count($name, '\\') >= 2) {
|
if (strpos($name, 'OCA\\') === 0 && substr_count($name, '\\') >= 2) {
|
||||||
|
|
Loading…
Reference in New Issue