Skip to content

Commit cd6c647

Browse files
committed
chore: remove tests with reflection
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent a6564f3 commit cd6c647

1 file changed

Lines changed: 0 additions & 57 deletions

File tree

tests/php/Unit/Helper/ValidateHelperTest.php

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -625,63 +625,6 @@ public static function datavalidateIfIdentifyMethodExists(): array {
625625
];
626626
}
627627

628-
#[DataProvider('providerValidateSignersDataStructure')]
629-
public function testValidateSignersDataStructure(array $data, ?string $expectedException, ?string $expectedMessage): void {
630-
$validateHelper = $this->getValidateHelper();
631-
632-
if ($expectedException) {
633-
$this->expectException($expectedException);
634-
if ($expectedMessage) {
635-
$this->expectExceptionMessage($expectedMessage);
636-
}
637-
}
638-
639-
// Use reflection to test private method
640-
$method = new \ReflectionMethod($validateHelper, 'validateSignersDataStructure');
641-
$method->invoke($validateHelper, $data);
642-
643-
if (!$expectedException) {
644-
$this->assertTrue(true);
645-
}
646-
}
647-
648-
public static function providerValidateSignersDataStructure(): array {
649-
return [
650-
'Empty data' => [[], LibresignException::class, 'No signers'],
651-
'No users key' => [['invalid' => 'data'], LibresignException::class, 'No signers'],
652-
'Users is not array' => [['users' => 'invalid'], LibresignException::class, 'No signers'],
653-
'Valid structure' => [['users' => []], null, null],
654-
];
655-
}
656-
657-
#[DataProvider('providerValidateSignerData')]
658-
public function testValidateSignerData($signer, ?string $expectedException, ?string $expectedMessage): void {
659-
$validateHelper = $this->getValidateHelper();
660-
661-
if ($expectedException) {
662-
$this->expectException($expectedException);
663-
if ($expectedMessage) {
664-
$this->expectExceptionMessage($expectedMessage);
665-
}
666-
}
667-
668-
$method = new \ReflectionMethod($validateHelper, 'validateSignerData');
669-
$method->invoke($validateHelper, $signer);
670-
671-
if (!$expectedException) {
672-
$this->assertTrue(true);
673-
}
674-
}
675-
676-
public static function providerValidateSignerData(): array {
677-
return [
678-
'Signer is not array' => ['invalid', LibresignException::class, 'No signers'],
679-
'Empty signer' => [[], LibresignException::class, 'No signers'],
680-
'No identify methods' => [['name' => 'User'], LibresignException::class, 'No identify methods for signer'],
681-
'Identify is not array' => [['identify' => 'invalid'], LibresignException::class, 'No identify methods for signer'],
682-
];
683-
}
684-
685628
public function testValidateIdentifyMethodForRequestWithNoSignatureMethods(): void {
686629
$identifyMethod = $this->createMock(IIdentifyMethod::class);
687630
$identifyMethod->method('getSignatureMethods')->willReturn([]);

0 commit comments

Comments
 (0)