Fix tests for LoginController

This commit is contained in:
Lukas Reschke 2016-08-15 17:19:32 +02:00
parent 349f5e4a60
commit ab9a8ce952
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 4 additions and 5 deletions

View File

@ -181,6 +181,7 @@ class LoginControllerTest extends TestCase {
'alt_login' => [],
'rememberLoginAllowed' => \OC_Util::rememberLoginAllowed(),
'rememberLoginState' => 0,
'resetPasswordLink' => null,
],
'guest'
);
@ -239,6 +240,7 @@ class LoginControllerTest extends TestCase {
'alt_login' => [],
'rememberLoginAllowed' => \OC_Util::rememberLoginAllowed(),
'rememberLoginState' => 0,
'resetPasswordLink' => false,
],
'guest'
);
@ -277,6 +279,7 @@ class LoginControllerTest extends TestCase {
'alt_login' => [],
'rememberLoginAllowed' => \OC_Util::rememberLoginAllowed(),
'rememberLoginState' => 0,
'resetPasswordLink' => false,
],
'guest'
);
@ -324,7 +327,7 @@ class LoginControllerTest extends TestCase {
/** @var IUser | \PHPUnit_Framework_MockObject_MockObject $user */
$user = $this->getMock('\OCP\IUser');
$password = 'secret';
$indexPageUrl = 'some url';
$indexPageUrl = 'http://localhost/index.php/apps/files/';
$this->request
->expects($this->exactly(2))
@ -352,10 +355,6 @@ class LoginControllerTest extends TestCase {
->method('isTwoFactorAuthenticated')
->with($user)
->will($this->returnValue(false));
$this->urlGenerator->expects($this->once())
->method('linkToRoute')
->with('files.view.index')
->will($this->returnValue($indexPageUrl));
$expected = new \OCP\AppFramework\Http\RedirectResponse($indexPageUrl);
$this->assertEquals($expected, $this->loginController->tryLogin($user, $password, null));