diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2019-06-14 14:12:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-14 14:12:50 +0200 |
commit | bf18f1ee934b71e21b060450a30e321d98ab2da2 (patch) | |
tree | 0c085b17e659c1b8298996689912746636187459 /apps/comments | |
parent | 85767660baa8b9e686303b091da8c96b13345f86 (diff) | |
parent | e9351ef779ea8e462062eaeb3e1824fe66829f7d (diff) | |
download | nextcloud-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.php | 23 |
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()) |