Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-09 14:26:53 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-09 14:26:53 +0300
commitb955ce61413158636078847440f83ff75725d01c (patch)
tree7df9afa253465ccd0fc025cb27cdbef6ac8b7b89 /apps
parente2b43c409553fdfe0b827ce6c016a831a9f75bbb (diff)
parent17f5f19187bcaf2ec67a80fbedf5391e0ba348a0 (diff)
Merge pull request #22886 from owncloud/stable9-show-version-to-update-to
[stable9] Show version to update to properly
Diffstat (limited to 'apps')
-rw-r--r--apps/updatenotification/controller/admincontroller.php5
-rw-r--r--apps/updatenotification/tests/controller/AdminControllerTest.php4
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/updatenotification/controller/admincontroller.php b/apps/updatenotification/controller/admincontroller.php
index cb0c6409d7e..5dbcc685809 100644
--- a/apps/updatenotification/controller/admincontroller.php
+++ b/apps/updatenotification/controller/admincontroller.php
@@ -99,12 +99,13 @@ class AdminController extends Controller {
if(($key = array_search($currentChannel, $channels)) !== false) {
unset($channels[$key]);
}
-
+ $updateState = $this->updateChecker->getUpdateState();
$params = [
- 'isNewVersionAvailable' => ($this->updateChecker->getUpdateState() === []) ? false : true,
+ 'isNewVersionAvailable' => ($updateState === []) ? false : true,
'lastChecked' => $lastUpdateCheck,
'currentChannel' => $currentChannel,
'channels' => $channels,
+ 'newVersionString' => ($updateState === []) ? '' : $updateState['updateVersion'],
];
return new TemplateResponse($this->appName, 'admin', $params, '');
diff --git a/apps/updatenotification/tests/controller/AdminControllerTest.php b/apps/updatenotification/tests/controller/AdminControllerTest.php
index 50adcd2028b..d8fc2dd335c 100644
--- a/apps/updatenotification/tests/controller/AdminControllerTest.php
+++ b/apps/updatenotification/tests/controller/AdminControllerTest.php
@@ -107,13 +107,14 @@ class AdminControllerTest extends TestCase {
$this->updateChecker
->expects($this->once())
->method('getUpdateState')
- ->willReturn(['foo' => 'bar']);
+ ->willReturn(['updateVersion' => '8.1.2']);
$params = [
'isNewVersionAvailable' => true,
'lastChecked' => 'LastCheckedReturnValue',
'currentChannel' => \OCP\Util::getChannel(),
'channels' => $channels,
+ 'newVersionString' => '8.1.2',
];
$expected = new TemplateResponse('updatenotification', 'admin', $params, '');
@@ -154,6 +155,7 @@ class AdminControllerTest extends TestCase {
'lastChecked' => 'LastCheckedReturnValue',
'currentChannel' => \OCP\Util::getChannel(),
'channels' => $channels,
+ 'newVersionString' => '',
];
$expected = new TemplateResponse('updatenotification', 'admin', $params, '');