Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
27a3c68d
Unverified
Commit
27a3c68d
authored
8 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests
parent
202ae425
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/updatenotification/tests/Controller/AdminControllerTest.php
+6
-1
6 additions, 1 deletion
...datenotification/tests/Controller/AdminControllerTest.php
apps/updatenotification/tests/UpdateCheckerTest.php
+9
-6
9 additions, 6 deletions
apps/updatenotification/tests/UpdateCheckerTest.php
with
15 additions
and
7 deletions
apps/updatenotification/tests/Controller/AdminControllerTest.php
+
6
−
1
View file @
27a3c68d
...
...
@@ -111,7 +111,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'
,
]);
$params
=
[
'isNewVersionAvailable'
=>
true
,
...
...
@@ -120,6 +123,7 @@ class AdminControllerTest extends TestCase {
'channels'
=>
$channels
,
'newVersionString'
=>
'8.1.2'
,
'notify_groups'
=>
'admin'
,
'downloadLink'
=>
'https://downloads.nextcloud.org/server'
,
];
$expected
=
new
TemplateResponse
(
'updatenotification'
,
'admin'
,
$params
,
''
);
...
...
@@ -164,6 +168,7 @@ class AdminControllerTest extends TestCase {
'channels'
=>
$channels
,
'newVersionString'
=>
''
,
'notify_groups'
=>
'admin'
,
'downloadLink'
=>
''
,
];
$expected
=
new
TemplateResponse
(
'updatenotification'
,
'admin'
,
$params
,
''
);
...
...
This diff is collapsed.
Click to expand it.
apps/updatenotification/tests/UpdateCheckerTest.php
+
9
−
6
View file @
27a3c68d
...
...
@@ -47,13 +47,14 @@ class UpdateCheckerTest extends TestCase {
->
method
(
'check'
)
->
willReturn
([
'version'
=>
123
,
'versionstring'
=>
'
ownC
loud 123'
,
'versionstring'
=>
'
Nextc
loud 123'
,
'web'
=>
'javascript:alert(1)'
,
'url'
=>
'javascript:alert(2)'
,
]);
$expected
=
[
'updateAvailable'
=>
true
,
'updateVersion'
=>
'
ownC
loud 123'
,
'updateVersion'
=>
'
Nextc
loud 123'
,
];
$this
->
assertSame
(
$expected
,
$this
->
updateChecker
->
getUpdateState
());
}
...
...
@@ -64,14 +65,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
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment