summaryrefslogtreecommitdiffstats
path: root/apps/comments/tests/Unit
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-06-12 14:40:42 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-06-13 14:58:38 +0200
commite9351ef779ea8e462062eaeb3e1824fe66829f7d (patch)
treebbb3424408068cb6826853b494321d35ba8f800b /apps/comments/tests/Unit
parent7382655a2c5a613cc923e9abd8142119d9de8d5c (diff)
downloadnextcloud-server-e9351ef779ea8e462062eaeb3e1824fe66829f7d.tar.gz
nextcloud-server-e9351ef779ea8e462062eaeb3e1824fe66829f7d.zip
Add strict type on Notifications tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/comments/tests/Unit')
-rw-r--r--apps/comments/tests/Unit/Controller/NotificationsTest.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/apps/comments/tests/Unit/Controller/NotificationsTest.php b/apps/comments/tests/Unit/Controller/NotificationsTest.php
index 9897027b824..c5209b9f9d5 100644
--- a/apps/comments/tests/Unit/Controller/NotificationsTest.php
+++ b/apps/comments/tests/Unit/Controller/NotificationsTest.php
@@ -125,6 +125,7 @@ class NotificationsTest extends TestCase {
$file = $this->createMock(Node::class);
$folder = $this->createMock(Folder::class);
+ $user = $this->createMock(IUser::class);
$this->rootFolder->expects($this->once())
->method('getUserFolder')
@@ -136,7 +137,11 @@ class NotificationsTest extends TestCase {
$this->session->expects($this->once())
->method('getUser')
- ->willReturn($this->createMock(IUser::class));
+ ->willReturn($user);
+
+ $user->expects($this->any())
+ ->method('getUID')
+ ->willReturn('user');
$notification = $this->createMock(INotification::class);
$notification->expects($this->any())
@@ -163,9 +168,15 @@ class NotificationsTest extends TestCase {
$this->rootFolder->expects($this->never())
->method('getUserFolder');
+ $user = $this->createMock(IUser::class);
+
$this->session->expects($this->once())
->method('getUser')
- ->willReturn($this->createMock(IUser::class));
+ ->willReturn($user);
+
+ $user->expects($this->any())
+ ->method('getUID')
+ ->willReturn('user');
$this->notificationManager->expects($this->never())
->method('createNotification');
@@ -197,9 +208,15 @@ class NotificationsTest extends TestCase {
->method('getById')
->willReturn([]);
+ $user = $this->createMock(IUser::class);
+
$this->session->expects($this->once())
->method('getUser')
- ->willReturn($this->createMock(IUser::class));
+ ->willReturn($user);
+
+ $user->expects($this->any())
+ ->method('getUID')
+ ->willReturn('user');
$notification = $this->createMock(INotification::class);
$notification->expects($this->any())