]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cleanup comment tests
authorJoas Schilling <coding@schilljs.com>
Mon, 9 Jan 2017 11:03:34 +0000 (12:03 +0100)
committerJoas Schilling <coding@schilljs.com>
Mon, 9 Jan 2017 11:03:34 +0000 (12:03 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/comments/lib/Notification/Listener.php
apps/comments/tests/Unit/Notification/ListenerTest.php

index 2f94b8a3d752050526530ec3357cbebe1d70fd21..365f93ce8dd8502eff40af5fae49975301b5f53a 100644 (file)
@@ -23,7 +23,6 @@ namespace OCA\Comments\Notification;
 
 use OCP\Comments\CommentsEvent;
 use OCP\Comments\IComment;
-use OCP\IURLGenerator;
 use OCP\IUserManager;
 use OCP\Notification\IManager;
 
@@ -34,25 +33,19 @@ class Listener {
        /** @var IUserManager */
        protected $userManager;
 
-       /** @var IURLGenerator */
-       protected $urlGenerator;
-
        /**
         * Listener constructor.
         *
         * @param IManager $notificationManager
         * @param IUserManager $userManager
-        * @param IURLGenerator $urlGenerator
         */
        public function __construct(
                IManager $notificationManager,
-               IUserManager $userManager,
-               IURLGenerator $urlGenerator
+               IUserManager $userManager
        ) {
 
                $this->notificationManager = $notificationManager;
                $this->userManager = $userManager;
-               $this->urlGenerator = $urlGenerator;
        }
 
        /**
index 3007b78cb3d770178a29c728ab8458541636e0d0..ef84d1c60de3317a82735031deaf3b5c3c4d6307 100644 (file)
@@ -46,14 +46,12 @@ class ListenerTest extends TestCase {
        protected function setUp() {
                parent::setUp();
 
-               $this->notificationManager = $this->getMockBuilder('\OCP\Notification\IManager')->getMock();
-               $this->userManager = $this->getMockBuilder('\OCP\IUserManager')->getMock();
-               $this->urlGenerator = $this->getMockBuilder('OCP\IURLGenerator')->getMock();
+               $this->notificationManager = $this->createMock(\OCP\Notification\IManager::class);
+               $this->userManager = $this->createMock(\OCP\IUserManager::class);
 
                $this->listener = new Listener(
                        $this->notificationManager,
-                       $this->userManager,
-                       $this->urlGenerator
+                       $this->userManager
                );
        }