Adjust unit tests

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2018-11-09 10:22:19 +01:00
parent 03b140c008
commit eff7a9c904
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
2 changed files with 11 additions and 7 deletions

View File

@ -104,6 +104,7 @@ class AdminTest extends TestCase {
->willReturn([ ->willReturn([
'updateAvailable' => true, 'updateAvailable' => true,
'updateVersion' => '8.1.2', 'updateVersion' => '8.1.2',
'updateVersionString' => 'Nextcloud 8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server', 'downloadLink' => 'https://downloads.nextcloud.org/server',
'changes' => [], 'changes' => [],
'updaterEnabled' => true, 'updaterEnabled' => true,
@ -129,7 +130,8 @@ class AdminTest extends TestCase {
'lastChecked' => 'LastCheckedReturnValue', 'lastChecked' => 'LastCheckedReturnValue',
'currentChannel' => Util::getChannel(), 'currentChannel' => Util::getChannel(),
'channels' => $channels, 'channels' => $channels,
'newVersionString' => '8.1.2', 'newVersion' => '8.1.2',
'newVersionString' => 'Nextcloud 8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server', 'downloadLink' => 'https://downloads.nextcloud.org/server',
'changes' => [], 'changes' => [],
'updaterEnabled' => true, 'updaterEnabled' => true,

View File

@ -51,8 +51,8 @@ class UpdateCheckerTest extends TestCase {
->expects($this->once()) ->expects($this->once())
->method('check') ->method('check')
->willReturn([ ->willReturn([
'version' => 123, 'version' => '1.2.3',
'versionstring' => 'Nextcloud 123', 'versionstring' => 'Nextcloud 1.2.3',
'web'=> 'javascript:alert(1)', 'web'=> 'javascript:alert(1)',
'url'=> 'javascript:alert(2)', 'url'=> 'javascript:alert(2)',
'changes' => 'javascript:alert(3)', 'changes' => 'javascript:alert(3)',
@ -62,7 +62,8 @@ class UpdateCheckerTest extends TestCase {
$expected = [ $expected = [
'updateAvailable' => true, 'updateAvailable' => true,
'updateVersion' => 'Nextcloud 123', 'updateVersion' => '1.2.3',
'updateVersionString' => 'Nextcloud 1.2.3',
'updaterEnabled' => false, 'updaterEnabled' => false,
'versionIsEol' => true, 'versionIsEol' => true,
]; ];
@ -91,8 +92,8 @@ class UpdateCheckerTest extends TestCase {
->expects($this->once()) ->expects($this->once())
->method('check') ->method('check')
->willReturn([ ->willReturn([
'version' => '123', 'version' => '1.2.3',
'versionstring' => 'Nextcloud 123', 'versionstring' => 'Nextcloud 1.2.3',
'web'=> 'https://docs.nextcloud.com/myUrl', 'web'=> 'https://docs.nextcloud.com/myUrl',
'url'=> 'https://downloads.nextcloud.org/server', 'url'=> 'https://downloads.nextcloud.org/server',
'changes' => 'https://updates.nextcloud.com/changelog_server/?version=123.0.0', 'changes' => 'https://updates.nextcloud.com/changelog_server/?version=123.0.0',
@ -106,7 +107,8 @@ class UpdateCheckerTest extends TestCase {
$expected = [ $expected = [
'updateAvailable' => true, 'updateAvailable' => true,
'updateVersion' => 'Nextcloud 123', 'updateVersion' => '1.2.3',
'updateVersionString' => 'Nextcloud 1.2.3',
'updaterEnabled' => true, 'updaterEnabled' => true,
'versionIsEol' => false, 'versionIsEol' => false,
'updateLink' => 'https://docs.nextcloud.com/myUrl', 'updateLink' => 'https://docs.nextcloud.com/myUrl',