Skip to content

Commit 7ade45b

Browse files
committed
test(handler): remove reflection-based CRL tests from AEngineHandlerTest
The CrlRevocationChecker is now injected, so the reflection workaround that forced private fields is no longer necessary. Related assertions are covered by CrlRevocationCheckerTest. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 42d59df commit 7ade45b

1 file changed

Lines changed: 0 additions & 47 deletions

File tree

tests/php/Unit/Handler/CertificateEngine/AEngineHandlerTest.php

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -339,22 +339,6 @@ public function testToArrayFiltersCaIdFromOrganizationalUnitWhenNotGenerated(
339339
}
340340
}
341341

342-
#[DataProvider('dataProviderCrlRevocationDateExtraction')]
343-
public function testExtractRevocationDateFromCrlText(
344-
string $crlText,
345-
array $serialNumbers,
346-
?string $expectedDate,
347-
string $description,
348-
): void {
349-
$instance = $this->getInstance();
350-
$method = new \ReflectionMethod(OpenSslHandler::class, 'extractRevocationDateFromCrlText');
351-
$method->setAccessible(true);
352-
353-
$result = $method->invoke($instance, $crlText, $serialNumbers);
354-
355-
$this->assertSame($expectedDate, $result, $description);
356-
}
357-
358342
public static function dataProviderToArray(): array {
359343
return [
360344
'Basic structure with minimal data' => [
@@ -434,35 +418,4 @@ public static function dataProviderToArrayCaIdFiltering(): array {
434418
],
435419
];
436420
}
437-
438-
public static function dataProviderCrlRevocationDateExtraction(): array {
439-
$crlText = implode("\n", [
440-
'Revoked Certificates:',
441-
' Serial Number: 0A',
442-
' Revocation Date: Jan 28 12:34:56 2026 GMT',
443-
' Serial Number: 0B',
444-
' Revocation Date: Jan 29 01:02:03 2026 GMT',
445-
]);
446-
447-
return [
448-
'Extract first revocation date' => [
449-
$crlText,
450-
['0A'],
451-
'2026-01-28T12:34:56+00:00',
452-
'Expected revocation date for serial 0A',
453-
],
454-
'Extract second revocation date with hex' => [
455-
$crlText,
456-
['0B', '0C'],
457-
'2026-01-29T01:02:03+00:00',
458-
'Expected revocation date for serial 0B',
459-
],
460-
'Revocation date not found' => [
461-
$crlText,
462-
['0D'],
463-
null,
464-
'No revocation date should be returned when serial not present',
465-
],
466-
];
467-
}
468421
}

0 commit comments

Comments
 (0)