summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/updatenotification/tests/Settings/AdminTest.php17
-rw-r--r--tests/lib/Updater/ChangesCheckTest.php2
2 files changed, 12 insertions, 7 deletions
diff --git a/apps/updatenotification/tests/Settings/AdminTest.php b/apps/updatenotification/tests/Settings/AdminTest.php
index ed9614a3b6b..d0d53226490 100644
--- a/apps/updatenotification/tests/Settings/AdminTest.php
+++ b/apps/updatenotification/tests/Settings/AdminTest.php
@@ -32,10 +32,16 @@ use OCP\IConfig;
use OCP\IDateTimeFormatter;
use OCP\IGroup;
use OCP\IGroupManager;
+use OCP\IUserSession;
+use OCP\L10N\IFactory;
use OCP\Util;
use Test\TestCase;
class AdminTest extends TestCase {
+ /** @var IUserSession|\PHPUnit_Framework_MockObject_MockObject */
+ protected $userSession;
+ /** @var IFactory|\PHPUnit_Framework_MockObject_MockObject */
+ protected $l10nFactory;
/** @var Admin */
private $admin;
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
@@ -54,12 +60,11 @@ class AdminTest extends TestCase {
$this->updateChecker = $this->createMock(UpdateChecker::class);
$this->groupManager = $this->createMock(IGroupManager::class);
$this->dateTimeFormatter = $this->createMock(IDateTimeFormatter::class);
+ $this->userSession = $this->createMock(IUserSession::class);
+ $this->l10nFactory = $this->createMock(IFactory::class);
$this->admin = new Admin(
- $this->config,
- $this->updateChecker,
- $this->groupManager,
- $this->dateTimeFormatter
+ $this->config, $this->updateChecker, $this->groupManager, $this->dateTimeFormatter, $this->userSession, $this->l10nFactory
);
}
@@ -99,7 +104,7 @@ class AdminTest extends TestCase {
'updateAvailable' => true,
'updateVersion' => '8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
- 'changes' => 'https://updates.nextcloud.com/changelog_server/?version=8.1.2',
+ 'changes' => [],
'updaterEnabled' => true,
'versionIsEol' => false,
]);
@@ -125,7 +130,7 @@ class AdminTest extends TestCase {
'channels' => $channels,
'newVersionString' => '8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
- 'changesURL' => 'https://updates.nextcloud.com/changelog_server/?version=8.1.2',
+ 'changes' => [],
'updaterEnabled' => true,
'versionIsEol' => false,
'isDefaultUpdateServerURL' => true,
diff --git a/tests/lib/Updater/ChangesCheckTest.php b/tests/lib/Updater/ChangesCheckTest.php
index 5f7e8ad4f0a..cbb298647d0 100644
--- a/tests/lib/Updater/ChangesCheckTest.php
+++ b/tests/lib/Updater/ChangesCheckTest.php
@@ -307,7 +307,7 @@ class ChangesCheckTest extends TestCase {
->method('__call')
->willReturn($etag);
- $expectedHeaders = $etag === '' ? [] : ['If-None-Match: ' . $etag];
+ $expectedHeaders = $etag === '' ? [] : ['If-None-Match' => [$etag]];
$client = $this->createMock(IClient::class);
$client->expects($this->once())