diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-10 17:34:57 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-06-10 17:34:57 +0300 |
commit | 09811cd6ccadbf0c7286f517c08fd0f9496ed73a (patch) | |
tree | 0c87c83e74397e3ba8557ba783c7b0da63c809c2 /tests | |
parent | c58aa048d6f214d32354b6eab81f18eb8d22f6eb (diff) |
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/php/BackgroundJob/CheckHostedSignalingServerTest.php | 20 | ||||
-rw-r--r-- | tests/php/Notification/NotifierTest.php | 3 |
2 files changed, 14 insertions, 9 deletions
diff --git a/tests/php/BackgroundJob/CheckHostedSignalingServerTest.php b/tests/php/BackgroundJob/CheckHostedSignalingServerTest.php index 1e3c10f3e..41b71bf62 100644 --- a/tests/php/BackgroundJob/CheckHostedSignalingServerTest.php +++ b/tests/php/BackgroundJob/CheckHostedSignalingServerTest.php @@ -31,24 +31,28 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; use OCP\IGroup; use OCP\IGroupManager; +use OCP\ILogger; use OCP\IURLGenerator; use OCP\Notification\IManager; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class CheckHostedSignalingServerTest extends TestCase { - /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */ + /** @var ITimeFactory|MockObject */ protected $timeFactory; - /** @var HostedSignalingServerService|\PHPUnit\Framework\MockObject\MockObject */ + /** @var HostedSignalingServerService|MockObject */ protected $hostedSignalingServerService; - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IConfig|MockObject */ protected $config; - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IManager|MockObject */ protected $notificationManager; - /** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IGroupManager|MockObject */ protected $groupManager; - /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IURLGenerator|MockObject */ protected $urlGenerator; + /** @var ILogger|MockObject */ + protected $logger; public function setUp(): void { parent::setUp(); @@ -59,6 +63,7 @@ class CheckHostedSignalingServerTest extends TestCase { $this->notificationManager = $this->createMock(IManager::class); $this->groupManager = $this->createMock(IGroupManager::class); $this->urlGenerator = $this->createMock(IURLGenerator::class); + $this->logger = $this->createMock(ILogger::class); } public function getBackgroundJob(): CheckHostedSignalingServer { @@ -68,7 +73,8 @@ class CheckHostedSignalingServerTest extends TestCase { $this->config, $this->notificationManager, $this->groupManager, - $this->urlGenerator + $this->urlGenerator, + $this->logger ); } diff --git a/tests/php/Notification/NotifierTest.php b/tests/php/Notification/NotifierTest.php index fc8901355..90d919b4e 100644 --- a/tests/php/Notification/NotifierTest.php +++ b/tests/php/Notification/NotifierTest.php @@ -264,7 +264,6 @@ class NotifierTest extends \Test\TestCase { [$uid, $u], ]); - $n = $this->getNotificationMock($parsedSubject, $uid, $displayName); $this->notifier->prepare($n, 'de'); $n = $this->getNotificationMock($parsedSubject, $uid, $displayName); @@ -318,7 +317,7 @@ class NotifierTest extends \Test\TestCase { $n->expects($this->once()) ->method('getSubjectParameters') ->willReturn([$uid]); - $n->expects($this->once()) + $n->expects($this->exactly(2)) ->method('getObjectType') ->willReturn('room'); $n->expects($this->once()) |