Skip to content

Commit 99f9c4b

Browse files
committed
fix: unit tests
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 7a3cb25 commit 99f9c4b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tests/php/Unit/Service/IdentifyMethod/PasswordTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use OCA\Libresign\Handler\CertificateEngine\CertificateEngineFactory;
1414
use OCA\Libresign\Handler\FooterHandler;
1515
use OCA\Libresign\Handler\SignEngine\Pkcs12Handler;
16+
use OCA\Libresign\Service\CaIdentifierService;
1617
use OCA\Libresign\Service\FolderService;
1718
use OCA\Libresign\Service\IdentifyMethod\IdentifyService;
1819
use OCA\Libresign\Service\IdentifyMethod\SignatureMethod\Password;
@@ -36,6 +37,7 @@ final class PasswordTest extends \OCA\Libresign\Tests\Unit\TestCase {
3637
private FooterHandler&MockObject $footerHandler;
3738
private ITempManager $tempManager;
3839
private LoggerInterface&MockObject $logger;
40+
private CaIdentifierService&MockObject $caIdentifierService;
3941

4042
public function setUp(): void {
4143
$this->identifyService = $this->createMock(IdentifyService::class);
@@ -47,6 +49,7 @@ public function setUp(): void {
4749
$this->tempManager = \OCP\Server::get(ITempManager::class);
4850
$this->userSession = $this->createMock(IUserSession::class);
4951
$this->logger = $this->createMock(LoggerInterface::class);
52+
$this->caIdentifierService = $this->createMock(CaIdentifierService::class);
5053
$this->pkcs12Handler = $this->getPkcs12Instance();
5154
}
5255

@@ -71,6 +74,7 @@ private function getPkcs12Instance(array $methods = []) {
7174
$this->footerHandler,
7275
$this->tempManager,
7376
$this->logger,
77+
$this->caIdentifierService,
7478
])
7579
->onlyMethods($methods)
7680
->getMock();

tests/php/Unit/Service/InstallServiceTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use bovigo\vfs\vfsStream;
1212
use OCA\Libresign\Handler\CertificateEngine\CertificateEngineFactory;
13+
use OCA\Libresign\Service\CaIdentifierService;
1314
use OCA\Libresign\Service\Install\InstallService;
1415
use OCA\Libresign\Service\Install\SignSetupService;
1516
use OCP\Files\AppData\IAppDataFactory;
@@ -30,6 +31,7 @@ final class InstallServiceTest extends \OCA\Libresign\Tests\Unit\TestCase {
3031
private LoggerInterface&MockObject $logger;
3132
private SignSetupService&MockObject $ignSetupService;
3233
private IAppDataFactory&MockObject $appDataFactory;
34+
private CaIdentifierService&MockObject $caIdentifierService;
3335

3436
public function setUp(): void {
3537
parent::setUp();
@@ -44,6 +46,7 @@ protected function getInstallService(): InstallService {
4446
$this->logger = $this->createMock(LoggerInterface::class);
4547
$this->ignSetupService = $this->createMock(SignSetupService::class);
4648
$this->appDataFactory = $this->createMock(IAppDataFactory::class);
49+
$this->caIdentifierService = $this->createMock(CaIdentifierService::class);
4750
return new InstallService(
4851
$this->cacheFactory,
4952
$this->clientService,
@@ -52,7 +55,8 @@ protected function getInstallService(): InstallService {
5255
$this->appConfig,
5356
$this->logger,
5457
$this->ignSetupService,
55-
$this->appDataFactory
58+
$this->appDataFactory,
59+
$this->caIdentifierService,
5660
);
5761
}
5862

0 commit comments

Comments
 (0)