Skip to content

Commit 5258211

Browse files
lfalsbackportbot-libresign[bot]
authored andcommitted
test(account-service): update config interface mocks
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
1 parent 4d610bb commit 5258211

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/php/Unit/Service/AccountServiceTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use OCA\Libresign\Service\SignerElementsService;
3131
use OCA\Libresign\Service\SignFileService;
3232
use OCA\Settings\Mailer\NewUserMailHelper;
33+
use OCP\Config\IUserConfig;
3334
use OCP\Accounts\IAccountManager;
3435
use OCP\AppFramework\Db\DoesNotExistException;
3536
use OCP\Files\Config\IMountProviderCollection;
@@ -39,7 +40,6 @@
3940
use OCP\Files\IRootFolder;
4041
use OCP\Files\NotFoundException;
4142
use OCP\IAppConfig;
42-
use OCP\IConfig;
4343
use OCP\IGroupManager;
4444
use OCP\IL10N;
4545
use OCP\IURLGenerator;
@@ -63,8 +63,8 @@ final class AccountServiceTest extends \OCA\Libresign\Tests\Unit\TestCase {
6363
private FileTypeMapper&MockObject $fileTypeMapper;
6464
private SignFileService&MockObject $signFile;
6565
private CertificateEngineFactory&MockObject $certificateEngineFactory;
66-
private IConfig&MockObject $config;
6766
private IAppConfig&MockObject $appConfig;
67+
private IUserConfig&MockObject $userConfig;
6868
private IMountProviderCollection&MockObject $mountProviderCollection;
6969
private NewUserMailHelper&MockObject $newUserMail;
7070
private IdentifyMethodService&MockObject $identifyMethodService;
@@ -98,8 +98,8 @@ public function setUp(): void {
9898
$this->signFile = $this->createMock(SignFileService::class);
9999
$this->requestSignatureService = $this->createMock(RequestSignatureService::class);
100100
$this->certificateEngineFactory = $this->createMock(CertificateEngineFactory::class);
101-
$this->config = $this->createMock(IConfig::class);
102101
$this->appConfig = $this->createMock(IAppConfig::class);
102+
$this->userConfig = $this->createMock(IUserConfig::class);
103103
$this->mountProviderCollection = $this->createMock(IMountProviderCollection::class);
104104
$this->newUserMail = $this->createMock(NewUserMailHelper::class);
105105
$this->identifyMethodService = $this->createMock(IdentifyMethodService::class);
@@ -130,8 +130,8 @@ private function getService(): AccountService {
130130
$this->signFile,
131131
$this->requestSignatureService,
132132
$this->certificateEngineFactory,
133-
$this->config,
134133
$this->appConfig,
134+
$this->userConfig,
135135
$this->mountProviderCollection,
136136
$this->newUserMail,
137137
$this->identifyMethodService,
@@ -218,7 +218,7 @@ public function testCreateToSignWithErrorInSendingEmail():void {
218218
$userToSign->method('getUID')->willReturn('username');
219219
$this->userManager->method('createUser')->willReturn($userToSign);
220220
$this->identifyMethodService->method('getIdentifyMethodsFromSignRequestId')->willReturn([]);
221-
$this->config->method('getAppValue')->willReturn('yes');
221+
$this->appConfig->method('getValueString')->willReturn('yes');
222222
$template = $this->createMock(\OCP\Mail\IEMailTemplate::class);
223223
$this->newUserMail->method('generateTemplate')->willReturn($template);
224224
$this->newUserMail->method('sendMail')->willReturnCallback(function ():void {

0 commit comments

Comments
 (0)