Cleanup comment tests

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/2982/head
Joas Schilling 9 years ago
parent 315645ada3
commit bb84db02cb
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
  1. 9
      apps/comments/lib/Notification/Listener.php
  2. 8
      apps/comments/tests/Unit/Notification/ListenerTest.php

@ -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;
}
/**

@ -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
);
}

Loading…
Cancel
Save