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
6734e871
Unverified
Commit
6734e871
authored
6 years ago
by
John Molakvoæ
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests
Signed-off-by:
John Molakvoæ (skjnldsv)
<
skjnldsv@protonmail.com
>
parent
5e4990fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/Core/Controller/ClientFlowLoginControllerTest.php
+0
-64
0 additions, 64 deletions
tests/Core/Controller/ClientFlowLoginControllerTest.php
with
0 additions
and
64 deletions
tests/Core/Controller/ClientFlowLoginControllerTest.php
+
0
−
64
View file @
6734e871
...
@@ -242,70 +242,6 @@ class ClientFlowLoginControllerTest extends TestCase {
...
@@ -242,70 +242,6 @@ class ClientFlowLoginControllerTest extends TestCase {
$this
->
assertEquals
(
$expected
,
$this
->
clientFlowLoginController
->
showAuthPickerPage
(
'MyClientIdentifier'
));
$this
->
assertEquals
(
$expected
,
$this
->
clientFlowLoginController
->
showAuthPickerPage
(
'MyClientIdentifier'
));
}
}
public
function
testRedirectPageWithInvalidToken
()
{
$this
->
session
->
expects
(
$this
->
once
())
->
method
(
'get'
)
->
with
(
'client.flow.state.token'
)
->
willReturn
(
'OtherToken'
);
$expected
=
new
TemplateResponse
(
'core'
,
'403'
,
[
'file'
=>
'State token does not match'
,
],
'guest'
);
$expected
->
setStatus
(
Http
::
STATUS_FORBIDDEN
);
$this
->
assertEquals
(
$expected
,
$this
->
clientFlowLoginController
->
redirectPage
(
'MyStateToken'
));
}
public
function
testRedirectPageWithoutToken
()
{
$this
->
session
->
expects
(
$this
->
once
())
->
method
(
'get'
)
->
with
(
'client.flow.state.token'
)
->
willReturn
(
null
);
$expected
=
new
TemplateResponse
(
'core'
,
'403'
,
[
'file'
=>
'State token does not match'
,
],
'guest'
);
$expected
->
setStatus
(
Http
::
STATUS_FORBIDDEN
);
$this
->
assertEquals
(
$expected
,
$this
->
clientFlowLoginController
->
redirectPage
(
'MyStateToken'
));
}
public
function
testRedirectPage
()
{
$this
->
session
->
expects
(
$this
->
at
(
0
))
->
method
(
'get'
)
->
with
(
'client.flow.state.token'
)
->
willReturn
(
'MyStateToken'
);
$this
->
session
->
expects
(
$this
->
at
(
1
))
->
method
(
'get'
)
->
with
(
'oauth.state'
)
->
willReturn
(
'MyOauthStateToken'
);
$expected
=
new
TemplateResponse
(
'core'
,
'loginflow/redirect'
,
[
'urlGenerator'
=>
$this
->
urlGenerator
,
'stateToken'
=>
'MyStateToken'
,
'clientIdentifier'
=>
'Identifier'
,
'oauthState'
=>
'MyOauthStateToken'
,
],
'guest'
);
$this
->
assertEquals
(
$expected
,
$this
->
clientFlowLoginController
->
redirectPage
(
'MyStateToken'
,
'Identifier'
));
}
public
function
testGenerateAppPasswordWithInvalidToken
()
{
public
function
testGenerateAppPasswordWithInvalidToken
()
{
$this
->
session
$this
->
session
->
expects
(
$this
->
once
())
->
expects
(
$this
->
once
())
...
...
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