Skip to content

Commit

Permalink
Adjust unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Nov 12, 2018
1 parent 90cd445 commit da21063
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion apps/updatenotification/tests/Settings/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public function testGetFormWithUpdate() {
->willReturn([
'updateAvailable' => true,
'updateVersion' => '8.1.2',
'updateVersionString' => 'Nextcloud 8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
'changes' => [],
'updaterEnabled' => true,
Expand All @@ -129,7 +130,8 @@ public function testGetFormWithUpdate() {
'lastChecked' => 'LastCheckedReturnValue',
'currentChannel' => Util::getChannel(),
'channels' => $channels,
'newVersionString' => '8.1.2',
'newVersion' => '8.1.2',
'newVersionString' => 'Nextcloud 8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
'changes' => [],
'updaterEnabled' => true,
Expand Down
14 changes: 8 additions & 6 deletions apps/updatenotification/tests/UpdateCheckerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public function testGetUpdateStateWithUpdateAndInvalidLink() {
->expects($this->once())
->method('check')
->willReturn([
'version' => 123,
'versionstring' => 'Nextcloud 123',
'version' => '1.2.3',
'versionstring' => 'Nextcloud 1.2.3',
'web'=> 'javascript:alert(1)',
'url'=> 'javascript:alert(2)',
'changes' => 'javascript:alert(3)',
Expand All @@ -62,7 +62,8 @@ public function testGetUpdateStateWithUpdateAndInvalidLink() {

$expected = [
'updateAvailable' => true,
'updateVersion' => 'Nextcloud 123',
'updateVersion' => '1.2.3',
'updateVersionString' => 'Nextcloud 1.2.3',
'updaterEnabled' => false,
'versionIsEol' => true,
];
Expand Down Expand Up @@ -91,8 +92,8 @@ public function testGetUpdateStateWithUpdateAndValidLink() {
->expects($this->once())
->method('check')
->willReturn([
'version' => '123',
'versionstring' => 'Nextcloud 123',
'version' => '1.2.3',
'versionstring' => 'Nextcloud 1.2.3',
'web'=> 'https://docs.nextcloud.com/myUrl',
'url'=> 'https://downloads.nextcloud.org/server',
'changes' => 'https://updates.nextcloud.com/changelog_server/?version=123.0.0',
Expand All @@ -106,7 +107,8 @@ public function testGetUpdateStateWithUpdateAndValidLink() {

$expected = [
'updateAvailable' => true,
'updateVersion' => 'Nextcloud 123',
'updateVersion' => '1.2.3',
'updateVersionString' => 'Nextcloud 1.2.3',
'updaterEnabled' => true,
'versionIsEol' => false,
'updateLink' => 'https://docs.nextcloud.com/myUrl',
Expand Down

0 comments on commit da21063

Please sign in to comment.