Fix tests
This commit is contained in:
parent
b42ee95383
commit
997e4cf3fe
|
@ -46,13 +46,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());
|
||||
}
|
||||
|
@ -63,14 +64,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());
|
||||
}
|
||||
|
|
|
@ -127,6 +127,7 @@ class AdminControllerTest extends TestCase {
|
|||
'channels' => $channels,
|
||||
'newVersionString' => '8.1.2',
|
||||
'updaterRequirementsFulfilled' => true,
|
||||
'downloadLink' => '',
|
||||
];
|
||||
|
||||
$expected = new TemplateResponse('updatenotification', 'admin', $params, '');
|
||||
|
@ -160,7 +161,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',
|
||||
]);
|
||||
$this->adminController
|
||||
->expects($this->once())
|
||||
->method('isCompatibleWithUpdater')
|
||||
|
@ -173,6 +177,7 @@ class AdminControllerTest extends TestCase {
|
|||
'channels' => $channels,
|
||||
'newVersionString' => '8.1.2',
|
||||
'updaterRequirementsFulfilled' => false,
|
||||
'downloadLink' => 'https://downloads.nextcloud.org/server',
|
||||
];
|
||||
|
||||
$expected = new TemplateResponse('updatenotification', 'admin', $params, '');
|
||||
|
@ -219,6 +224,7 @@ class AdminControllerTest extends TestCase {
|
|||
'channels' => $channels,
|
||||
'newVersionString' => '',
|
||||
'updaterRequirementsFulfilled' => true,
|
||||
'downloadLink' => '',
|
||||
];
|
||||
|
||||
$expected = new TemplateResponse('updatenotification', 'admin', $params, '');
|
||||
|
|
Loading…
Reference in New Issue