use OC\Authentication\TwoFactorAuth\ProviderLoader;
use OC\Settings\Personal\Security;
use OCP\AppFramework\Http\TemplateResponse;
+use OCP\IConfig;
use OCP\IInitialStateService;
use OCP\ISession;
use OCP\IUser;
/** @var ISession|MockObject */
private $session;
+ /** @var IConfig|MockObject */
+ private $config;
+
/** @var IInitialStateService|MockObject */
private $initialStateService;
$this->authTokenProvider = $this->createMock(IAuthTokenProvider::class);
$this->providerLoader = $this->createMock(ProviderLoader::class);
$this->userSession = $this->createMock(IUserSession::class);
+ $this->config = $this->createMock(IConfig::class);
$this->session = $this->createMock(ISession::class);
$this->initialStateService = $this->createMock(IInitialStateService::class);
$this->uid = 'test123';
$this->providerLoader,
$this->userSession,
$this->session,
+ $this->config,
$this->initialStateService,
$this->uid
);
->method('getProviders')
->with($user)
->willReturn([]);
+ $this->config->expects($this->once())
+ ->method('getUserValue')
+ ->with(
+ $this->uid,
+ 'accessibility',
+ 'theme',
+ false
+ )
+ ->willReturn(false);
$form = $this->section->getForm();
'twoFactorProviderData' => [
'providers' => [],
],
+ 'themedark' => false,
]);
$this->assertEquals($expected, $form);
}