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
b1d80847
Unverified
Commit
b1d80847
authored
7 years ago
by
Roeland Jago Douma
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests
Signed-off-by:
Roeland Jago Douma
<
roeland@famdouma.nl
>
parent
7cab7feb
No related branches found
Branches containing commit
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/LoginControllerTest.php
+18
-1
18 additions, 1 deletion
tests/Core/Controller/LoginControllerTest.php
with
18 additions
and
1 deletion
tests/Core/Controller/LoginControllerTest.php
+
18
−
1
View file @
b1d80847
...
...
@@ -23,6 +23,7 @@ namespace Tests\Core\Controller;
use
OC\Authentication\TwoFactorAuth\Manager
;
use
OC\Core\Controller\LoginController
;
use
OC\Security\Bruteforce\Throttler
;
use
OC\User\Session
;
use
OCP\AppFramework\Http\RedirectResponse
;
use
OCP\AppFramework\Http\TemplateResponse
;
...
...
@@ -57,6 +58,8 @@ class LoginControllerTest extends TestCase {
private
$twoFactorManager
;
/** @var Defaults|\PHPUnit_Framework_MockObject_MockObject */
private
$defaults
;
/** @var Throttler|\PHPUnit_Framework_MockObject_MockObject */
private
$throttler
;
public
function
setUp
()
{
parent
::
setUp
();
...
...
@@ -69,6 +72,15 @@ class LoginControllerTest extends TestCase {
$this
->
logger
=
$this
->
createMock
(
ILogger
::
class
);
$this
->
twoFactorManager
=
$this
->
createMock
(
Manager
::
class
);
$this
->
defaults
=
$this
->
createMock
(
Defaults
::
class
);
$this
->
throttler
=
$this
->
createMock
(
Throttler
::
class
);
$this
->
request
->
method
(
'getRemoteAddress'
)
->
willReturn
(
'1.2.3.4'
);
$this
->
throttler
->
method
(
'getDelay'
)
->
with
(
$this
->
equalTo
(
'1.2.3.4'
),
$this
->
equalTo
(
''
)
)
->
willReturn
(
1000
);
$this
->
loginController
=
new
LoginController
(
'core'
,
...
...
@@ -80,7 +92,8 @@ class LoginControllerTest extends TestCase {
$this
->
urlGenerator
,
$this
->
logger
,
$this
->
twoFactorManager
,
$this
->
defaults
$this
->
defaults
,
$this
->
throttler
);
}
...
...
@@ -183,6 +196,7 @@ class LoginControllerTest extends TestCase {
'rememberLoginState'
=>
0
,
'resetPasswordLink'
=>
null
,
'hideRemeberLoginState'
=>
false
,
'throttle_delay'
=>
1000
,
],
'guest'
);
...
...
@@ -213,6 +227,7 @@ class LoginControllerTest extends TestCase {
'rememberLoginState'
=>
0
,
'resetPasswordLink'
=>
null
,
'hideRemeberLoginState'
=>
true
,
'throttle_delay'
=>
1000
,
],
'guest'
);
...
...
@@ -272,6 +287,7 @@ class LoginControllerTest extends TestCase {
'rememberLoginState'
=>
0
,
'resetPasswordLink'
=>
false
,
'hideRemeberLoginState'
=>
false
,
'throttle_delay'
=>
1000
,
],
'guest'
);
...
...
@@ -311,6 +327,7 @@ class LoginControllerTest extends TestCase {
'rememberLoginState'
=>
0
,
'resetPasswordLink'
=>
false
,
'hideRemeberLoginState'
=>
false
,
'throttle_delay'
=>
1000
,
],
'guest'
);
...
...
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