diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-18 17:04:25 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-06-18 17:04:25 +0300 |
commit | 68774582499f8dac43bda415f458b3798d613761 (patch) | |
tree | dce4b5d0b873b4c5439ab7b21636183e4c2f7f5a /tests | |
parent | ca465e52c31e34a849998f5ac55bcff046b1c5d6 (diff) |
Fix service overwriting
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/php/Signaling/BackendNotifierTest.php | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/tests/php/Signaling/BackendNotifierTest.php b/tests/php/Signaling/BackendNotifierTest.php index fcd990292..a78bf2c40 100644 --- a/tests/php/Signaling/BackendNotifierTest.php +++ b/tests/php/Signaling/BackendNotifierTest.php @@ -123,14 +123,7 @@ class BackendNotifierTest extends \Test\TestCase { $this->config = new Config($config, $this->secureRandom, $groupManager, $this->timeFactory); $this->recreateBackendNotifier(); - - $this->app = new Application(); - $this->app->register(); - - $this->originalBackendNotifier = $this->app->getContainer()->query(BackendNotifier::class); - $this->app->getContainer()->registerService(BackendNotifier::class, function () { - return $this->controller; - }); + $this->overwriteService(BackendNotifier::class, $this->controller); $dbConnection = \OC::$server->getDatabaseConnection(); $this->dispatcher = \OC::$server->query(IEventDispatcher::class); @@ -151,9 +144,7 @@ class BackendNotifierTest extends \Test\TestCase { public function tearDown(): void { $config = \OC::$server->getConfig(); $config->deleteAppValue('spreed', 'signaling_servers'); - $this->app->getContainer()->registerService(BackendNotifier::class, function () { - return $this->originalBackendNotifier; - }); + $this->restoreService(BackendNotifier::class); parent::tearDown(); } |