summaryrefslogtreecommitdiffstats
path: root/tests/Unit/Controller/PageControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/Controller/PageControllerTest.php')
-rw-r--r--tests/Unit/Controller/PageControllerTest.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/Unit/Controller/PageControllerTest.php b/tests/Unit/Controller/PageControllerTest.php
index 2afe2d590..0c642fe29 100644
--- a/tests/Unit/Controller/PageControllerTest.php
+++ b/tests/Unit/Controller/PageControllerTest.php
@@ -22,6 +22,8 @@ use OCP\IConfig;
use OCP\IL10N;
use OCP\IRequest;
use OCP\IURLGenerator;
+use OCP\IUser;
+use OCP\IUserSession;
use PHPUnit\Framework\TestCase;
@@ -101,6 +103,15 @@ class PageControllerTest extends TestCase
$this->status = $this->getMockBuilder(StatusService::class)
->disableOriginalConstructor()
->getMock();
+ $this->user = $this->getMockBuilder(IUser::class)->getMock();
+ $this->user->expects($this->any())
+ ->method('getUID')
+ ->will($this->returnValue('becka'));
+ $this->userSession = $this->getMockBuilder(IUserSession::class)
+ ->getMock();
+ $this->userSession->expects($this->any())
+ ->method('getUser')
+ ->will($this->returnValue($this->user));
$this->controller = new PageController(
'news',
$this->request,
@@ -109,7 +120,7 @@ class PageControllerTest extends TestCase
$this->l10n,
$this->recommended,
$this->status,
- 'becka'
+ $this->userSession
);
}