use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
+use OCP\Files\SimpleFS\ISimpleFile;
use OCP\IAvatar;
use OCP\IAvatarManager;
use OCP\ICache;
private $avatarMock;
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject */
private $userMock;
- /** @var File|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var ISimpleFile|\PHPUnit\Framework\MockObject\MockObject */
private $avatarFile;
/** @var IAvatarManager|\PHPUnit\Framework\MockObject\MockObject */
$this->userManager->method('get')
->willReturnMap([['userId', $this->userMock]]);
- $this->avatarFile = $this->getMockBuilder('OCP\Files\File')->getMock();
+ $this->avatarFile = $this->getMockBuilder(ISimpleFile::class)->getMock();
$this->avatarFile->method('getContent')->willReturn('image data');
$this->avatarFile->method('getMimeType')->willReturn('image type');
$this->avatarFile->method('getEtag')->willReturn('my etag');
->willReturn('/default/foo');
$expectedResponse = new RedirectResponse('/default/foo');
- $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', '', ''));
+ $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', ''));
}
public function testShowLoginFormWithErrorsInSession() {
'login',
[
'alt_login' => [],
+ 'pageTitle' => 'Login'
],
'guest'
);
- $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', '', ''));
+ $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', ''));
}
public function testShowLoginFormForFlowAuth() {
'login',
[
'alt_login' => [],
+ 'pageTitle' => 'Login'
],
'guest'
);
- $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', 'login/flow', ''));
+ $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', 'login/flow'));
}
/**
* @return array
*/
- public function passwordResetDataProvider() {
+ public function passwordResetDataProvider(): array {
return [
[
true,
'login',
[
'alt_login' => [],
+ 'pageTitle' => 'Login'
],
'guest'
);
- $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('LdapUser', '', ''));
+ $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('LdapUser', ''));
}
public function testShowLoginFormForUserNamed0() {
'login',
[
'alt_login' => [],
+ 'pageTitle' => 'Login'
],
'guest'
);
- $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('0', '', ''));
+ $this->assertEquals($expectedResponse, $this->loginController->showLoginForm('0', ''));
}
public function testLoginWithInvalidCredentials() {