summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/tests
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-02-17 09:34:01 +0100
committerVincent Petry <vincent@nextcloud.com>2021-02-18 08:53:57 +0100
commit6ce469132c80a5a5cc45b1e7e215f43b538afd93 (patch)
treedbb295d5d2fe16e4c71a930c979f3897a4fd5c45 /apps/updatenotification/tests
parentd4b99c81f32453f57cb2c132fa46c6b5219b9e99 (diff)
downloadnextcloud-server-6ce469132c80a5a5cc45b1e7e215f43b538afd93.tar.gz
nextcloud-server-6ce469132c80a5a5cc45b1e7e215f43b538afd93.zip
Hide updater button when web updater is disabled
Whenever the web updater is disabled, the updater button and its matching token requesting endpoints are disabled. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/updatenotification/tests')
-rw-r--r--apps/updatenotification/tests/Settings/AdminTest.php24
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/updatenotification/tests/Settings/AdminTest.php b/apps/updatenotification/tests/Settings/AdminTest.php
index 78afc6a3ac0..e8e82391f96 100644
--- a/apps/updatenotification/tests/Settings/AdminTest.php
+++ b/apps/updatenotification/tests/Settings/AdminTest.php
@@ -93,10 +93,11 @@ class AdminTest extends TestCase {
['updatenotification', 'notify_groups', '["admin"]', '["admin"]'],
]);
$this->config
- ->expects($this->once())
->method('getSystemValue')
- ->with('updater.server.url', 'https://updates.nextcloud.com/updater_server/')
- ->willReturn('https://updates.nextcloud.com/updater_server/');
+ ->willReturnMap([
+ ['updater.server.url', 'https://updates.nextcloud.com/updater_server/', 'https://updates.nextcloud.com/updater_server/'],
+ ['upgrade.disable-web', false, false],
+ ]);
$this->dateTimeFormatter
->expects($this->once())
->method('formatDateTime')
@@ -143,6 +144,7 @@ class AdminTest extends TestCase {
'newVersionString' => 'Nextcloud 8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
'changes' => [],
+ 'webUpdaterEnabled' => true,
'updaterEnabled' => true,
'versionIsEol' => false,
'isDefaultUpdateServerURL' => true,
@@ -178,10 +180,11 @@ class AdminTest extends TestCase {
['updatenotification', 'notify_groups', '["admin"]', '["admin"]'],
]);
$this->config
- ->expects($this->once())
->method('getSystemValue')
- ->with('updater.server.url', 'https://updates.nextcloud.com/updater_server/')
- ->willReturn('https://updates.nextcloud.com/updater_server_changed/');
+ ->willReturnMap([
+ ['updater.server.url', 'https://updates.nextcloud.com/updater_server/', 'https://updates.nextcloud.com/updater_server_changed/'],
+ ['upgrade.disable-web', false, true],
+ ]);
$this->dateTimeFormatter
->expects($this->once())
->method('formatDateTime')
@@ -228,6 +231,7 @@ class AdminTest extends TestCase {
'newVersionString' => 'Nextcloud 8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
'changes' => [],
+ 'webUpdaterEnabled' => false,
'updaterEnabled' => true,
'versionIsEol' => false,
'isDefaultUpdateServerURL' => false,
@@ -263,10 +267,11 @@ class AdminTest extends TestCase {
['updatenotification', 'notify_groups', '["admin"]', '["admin"]'],
]);
$this->config
- ->expects($this->once())
->method('getSystemValue')
- ->with('updater.server.url', 'https://updates.nextcloud.com/updater_server/')
- ->willReturn('https://updates.nextcloud.com/customers/ABC-DEF/');
+ ->willReturnMap([
+ ['updater.server.url', 'https://updates.nextcloud.com/updater_server/', 'https://updates.nextcloud.com/customers/ABC-DEF/'],
+ ['upgrade.disable-web', false, false],
+ ]);
$this->dateTimeFormatter
->expects($this->once())
->method('formatDateTime')
@@ -313,6 +318,7 @@ class AdminTest extends TestCase {
'newVersionString' => 'Nextcloud 8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
'changes' => [],
+ 'webUpdaterEnabled' => true,
'updaterEnabled' => true,
'versionIsEol' => false,
'isDefaultUpdateServerURL' => true,