diff options
author | Joas Schilling <coding@schilljs.com> | 2016-09-08 11:13:36 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-09-08 11:13:36 +0200 |
commit | 27a3c68d840f2a8d8d212ba4086df10e0969c5e3 (patch) | |
tree | 62aac2a16e752d63eee18324d8c356c7d3bddd4a /apps | |
parent | 202ae42506e9bbb167889735b2c56ccebace594b (diff) | |
download | nextcloud-server-27a3c68d840f2a8d8d212ba4086df10e0969c5e3.tar.gz nextcloud-server-27a3c68d840f2a8d8d212ba4086df10e0969c5e3.zip |
Fix tests
Diffstat (limited to 'apps')
-rw-r--r-- | apps/updatenotification/tests/Controller/AdminControllerTest.php | 7 | ||||
-rw-r--r-- | apps/updatenotification/tests/UpdateCheckerTest.php | 15 |
2 files changed, 15 insertions, 7 deletions
diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php index 336edffc957..6d1ee219561 100644 --- a/apps/updatenotification/tests/Controller/AdminControllerTest.php +++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php @@ -111,7 +111,10 @@ class AdminControllerTest extends TestCase { $this->updateChecker ->expects($this->once()) ->method('getUpdateState') - ->willReturn(['updateVersion' => '8.1.2']); + ->willReturn([ + 'updateVersion' => '8.1.2', + 'downloadLink' => 'https://downloads.nextcloud.org/server', + ]); $params = [ 'isNewVersionAvailable' => true, @@ -120,6 +123,7 @@ class AdminControllerTest extends TestCase { 'channels' => $channels, 'newVersionString' => '8.1.2', 'notify_groups' => 'admin', + 'downloadLink' => 'https://downloads.nextcloud.org/server', ]; $expected = new TemplateResponse('updatenotification', 'admin', $params, ''); @@ -164,6 +168,7 @@ class AdminControllerTest extends TestCase { 'channels' => $channels, 'newVersionString' => '', 'notify_groups' => 'admin', + 'downloadLink' => '', ]; $expected = new TemplateResponse('updatenotification', 'admin', $params, ''); diff --git a/apps/updatenotification/tests/UpdateCheckerTest.php b/apps/updatenotification/tests/UpdateCheckerTest.php index c2c9ba1438d..38e64b6b5e5 100644 --- a/apps/updatenotification/tests/UpdateCheckerTest.php +++ b/apps/updatenotification/tests/UpdateCheckerTest.php @@ -47,13 +47,14 @@ class UpdateCheckerTest extends TestCase { ->method('check') ->willReturn([ 'version' => 123, - 'versionstring' => 'ownCloud 123', + 'versionstring' => 'Nextcloud 123', 'web'=> 'javascript:alert(1)', + 'url'=> 'javascript:alert(2)', ]); $expected = [ 'updateAvailable' => true, - 'updateVersion' => 'ownCloud 123', + 'updateVersion' => 'Nextcloud 123', ]; $this->assertSame($expected, $this->updateChecker->getUpdateState()); } @@ -64,14 +65,16 @@ class UpdateCheckerTest extends TestCase { ->method('check') ->willReturn([ 'version' => 123, - 'versionstring' => 'ownCloud 123', - 'web'=> 'https://owncloud.org/myUrl', + 'versionstring' => 'Nextcloud 123', + 'web'=> 'https://docs.nextcloud.com/myUrl', + 'url'=> 'https://downloads.nextcloud.org/server', ]); $expected = [ 'updateAvailable' => true, - 'updateVersion' => 'ownCloud 123', - 'updateLink' => 'https://owncloud.org/myUrl', + 'updateVersion' => 'Nextcloud 123', + 'updateLink' => 'https://docs.nextcloud.com/myUrl', + 'downloadLink' => 'https://downloads.nextcloud.org/server', ]; $this->assertSame($expected, $this->updateChecker->getUpdateState()); } |