summaryrefslogtreecommitdiffstats
path: root/apps/comments
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2019-06-14 14:12:50 +0200
committerGitHub <noreply@github.com>2019-06-14 14:12:50 +0200
commitbf18f1ee934b71e21b060450a30e321d98ab2da2 (patch)
tree0c085b17e659c1b8298996689912746636187459 /apps/comments
parent85767660baa8b9e686303b091da8c96b13345f86 (diff)
parente9351ef779ea8e462062eaeb3e1824fe66829f7d (diff)
downloadnextcloud-server-bf18f1ee934b71e21b060450a30e321d98ab2da2.tar.gz
nextcloud-server-bf18f1ee934b71e21b060450a30e321d98ab2da2.zip
Add strict type on Notifications tests (#15935)
Add strict type on Notifications tests
Diffstat (limited to 'apps/comments')
-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())