adjust tests

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2018-06-28 22:16:47 +02:00 committed by Morris Jobke
parent 6044733b2d
commit 241b59f458
No known key found for this signature in database
GPG key ID: FE03C3A163FEDE68
2 changed files with 12 additions and 7 deletions

View file

@ -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,

View file

@ -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())