summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-08-15 16:24:56 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-08-15 16:25:34 +0200
commit8a7a0f328746230dd896ccc53b3ada271a91b930 (patch)
treeaaaaedf7167b74c48a91c90671f705edb71bc541 /apps/updatenotification/tests
parent75a73a5a7301f203a962a17f6b2b8b90078c1884 (diff)
downloadnextcloud-server-8a7a0f328746230dd896ccc53b3ada271a91b930.tar.gz
nextcloud-server-8a7a0f328746230dd896ccc53b3ada271a91b930.zip
Add unit tests
Diffstat (limited to 'apps/updatenotification/tests')
-rw-r--r--apps/updatenotification/tests/Controller/AdminControllerTest.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php
index 0343542ef41..a4398715885 100644
--- a/apps/updatenotification/tests/Controller/AdminControllerTest.php
+++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php
@@ -59,15 +59,14 @@ class AdminControllerTest extends TestCase {
public function setUp() {
parent::setUp();
- $this->request = $this->getMock('\\OCP\\IRequest');
- $this->jobList = $this->getMock('\\OCP\\BackgroundJob\\IJobList');
- $this->secureRandom = $this->getMock('\\OCP\\Security\\ISecureRandom');
- $this->config = $this->getMock('\\OCP\\IConfig');
- $this->timeFactory = $this->getMock('\\OCP\\AppFramework\\Utility\\ITimeFactory');
- $this->l10n = $this->getMock('\\OCP\\IL10N');
- $this->updateChecker = $this->getMockBuilder('\\OCA\\UpdateNotification\\UpdateChecker')
- ->disableOriginalConstructor()->getMock();
- $this->dateTimeFormatter = $this->getMock('\\OCP\\IDateTimeFormatter');
+ $this->request = $this->createMock('\\OCP\\IRequest');
+ $this->jobList = $this->createMock('\\OCP\\BackgroundJob\\IJobList');
+ $this->secureRandom = $this->createMock('\\OCP\\Security\\ISecureRandom');
+ $this->config = $this->createMock('\\OCP\\IConfig');
+ $this->timeFactory = $this->createMock('\\OCP\\AppFramework\\Utility\\ITimeFactory');
+ $this->l10n = $this->createMock('\\OCP\\IL10N');
+ $this->updateChecker = $this->createMock('\\OCA\\UpdateNotification\\UpdateChecker');
+ $this->dateTimeFormatter = $this->createMock('\\OCP\\IDateTimeFormatter');
$this->adminController = new AdminController(
'updatenotification',
@@ -197,4 +196,12 @@ class AdminControllerTest extends TestCase {
$expected = new DataResponse('MyGeneratedToken');
$this->assertEquals($expected, $this->adminController->createCredentials());
}
+
+ public function testGetSection() {
+ $this->assertSame('server', $this->adminController->getSection());
+ }
+
+ public function testGetPriority() {
+ $this->assertSame(1, $this->adminController->getPriority());
+ }
}