Skip to content

Commit 4eeb266

Browse files
test(signing): align Password tests with handler-owned CRL policy
Remove the test scenario that depended on Password reading app config for MISSING status. Policy derivation now happens in AEngineHandler, so Password tests focus on status handling only. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 5bdfa75 commit 4eeb266

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ public function testValidateToSignWithCertificateData(
148148
$this->pkcs12Handler->method('readCertificate')->willReturn($certificateData);
149149

150150
$this->identifyService->method('getL10n')->willReturn($this->l10n);
151-
$this->identifyService->method('getAppConfig')->willReturn($this->appConfig);
152151

153152
$password = $this->getClass();
154153
$password->setCodeSentByUser('senha');
@@ -329,28 +328,4 @@ public static function providerValidateToSignWithCertificateData(): array {
329328
];
330329
}
331330

332-
public function testValidateToSignWithMissingCrlWhenExternalValidationDisabled(): void {
333-
$appConfig = $this->createMock(\OCP\IAppConfig::class);
334-
$appConfig->method('getValueBool')
335-
->with(Application::APP_ID, 'crl_external_validation_enabled', true)
336-
->willReturn(false);
337-
338-
$this->pkcs12Handler = $this->getPkcs12Instance(['getPfxOfCurrentSigner', 'setCertificate', 'setPassword', 'readCertificate']);
339-
$this->pkcs12Handler->method('getPfxOfCurrentSigner')->willReturn('mock-pfx');
340-
$this->pkcs12Handler->method('setCertificate')->willReturnSelf();
341-
$this->pkcs12Handler->method('setPassword')->willReturnSelf();
342-
$this->pkcs12Handler->method('readCertificate')->willReturn([
343-
'validTo_time_t' => (new \DateTime('+50 years'))->getTimestamp(),
344-
'crl_validation' => CrlValidationStatus::MISSING,
345-
]);
346-
$this->identifyService->method('getL10n')->willReturn($this->l10n);
347-
$this->identifyService->method('getAppConfig')->willReturn($appConfig);
348-
349-
$password = $this->getClass();
350-
$password->setCodeSentByUser('senha');
351-
$password->validateToSign();
352-
353-
// If we reach here, signing was allowed (no exception thrown).
354-
$this->expectNotToPerformAssertions();
355-
}
356331
}

0 commit comments

Comments
 (0)