]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix tests
authorJoas Schilling <coding@schilljs.com>
Thu, 8 Sep 2016 09:13:36 +0000 (11:13 +0200)
committerJoas Schilling <coding@schilljs.com>
Thu, 8 Sep 2016 09:13:36 +0000 (11:13 +0200)
apps/updatenotification/tests/Controller/AdminControllerTest.php
apps/updatenotification/tests/UpdateCheckerTest.php

index 336edffc9578f83be2e2bbb4f46aa75388d4a1a3..6d1ee219561376c977242e489f17436a7130ec4c 100644 (file)
@@ -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, '');
index c2c9ba1438dc3b9060046189fade4b49a29c31b4..38e64b6b5e55c1b83d532093007390e3da4bf94d 100644 (file)
@@ -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());
        }