diff options
-rw-r--r-- | lib/private/User/User.php | 5 | ||||
-rw-r--r-- | tests/lib/Comments/ManagerTest.php | 2 | ||||
-rw-r--r-- | tests/lib/ServerTest.php | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 580c590e6eb..28dfb741be8 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -40,6 +40,7 @@ use OC\Avatar\AvatarManager; use OC\Hooks\Emitter; use OC_Helper; use OCP\Accounts\IAccountManager; +use OCP\Comments\ICommentsManager; use OCP\EventDispatcher\IEventDispatcher; use OCP\Group\Events\BeforeUserRemovedEvent; use OCP\Group\Events\UserRemovedEvent; @@ -290,8 +291,8 @@ class User implements IUser { // Delete the user's keys in preferences \OC::$server->getConfig()->deleteAllUserValues($this->uid); - \OC::$server->getCommentsManager()->deleteReferencesOfActor('users', $this->uid); - \OC::$server->getCommentsManager()->deleteReadMarksFromUser($this); + \OC::$server->get(ICommentsManager::class)->deleteReferencesOfActor('users', $this->uid); + \OC::$server->get(ICommentsManager::class)->deleteReadMarksFromUser($this); /** @var AvatarManager $avatarManager */ $avatarManager = \OCP\Server::get(AvatarManager::class); diff --git a/tests/lib/Comments/ManagerTest.php b/tests/lib/Comments/ManagerTest.php index 9dcc24d12a1..69276b122b9 100644 --- a/tests/lib/Comments/ManagerTest.php +++ b/tests/lib/Comments/ManagerTest.php @@ -668,7 +668,7 @@ class ManagerTest extends TestCase { $user = \OC::$server->getUserManager()->createUser('xenia', '123456'); $this->assertTrue($user instanceof IUser); - $manager = \OC::$server->getCommentsManager(); + $manager = \OC::$server->get(ICommentsManager::class); $comment = $manager->create('users', $user->getUID(), 'files', 'file64'); $comment ->setMessage('Most important comment I ever left on the Internet.') diff --git a/tests/lib/ServerTest.php b/tests/lib/ServerTest.php index d9f95e9eab1..90f47eba231 100644 --- a/tests/lib/ServerTest.php +++ b/tests/lib/ServerTest.php @@ -26,6 +26,7 @@ namespace Test; use OC\App\AppStore\Fetcher\AppFetcher; use OC\App\AppStore\Fetcher\CategoryFetcher; +use OCP\Comments\ICommentsManager; /** * Class Server @@ -185,7 +186,7 @@ class ServerTest extends \Test\TestCase { $config->setSystemValue('comments.managerFactory', '\Test\Comments\FakeFactory'); - $manager = $this->server->getCommentsManager(); + $manager = $this->server->get(ICommentsManager::class); $this->assertInstanceOf('\OCP\Comments\ICommentsManager', $manager); $config->setSystemValue('comments.managerFactory', $defaultManagerFactory); |