Skip to content

Commit abfb7e6

Browse files
committed
chore: simplify test and compare actual and expected directly
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 558af57 commit abfb7e6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/php/Unit/Service/Certificate/RulesServiceTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ public function testGetRuleToValidField(string $fieldName, array $expected): voi
7777
$this->assertArrayHasKey('helperText', $actual);
7878
unset($actual['helperText']);
7979

80-
foreach ($actual as $fieldCode => $value) {
81-
$this->assertArrayHasKey($fieldCode, $expected);
82-
$this->assertSame($expected[$fieldCode], $value, "Mismatch for field: $fieldCode");
83-
}
80+
$this->assertCount(count($expected), $actual, "Expected count does not match actual count for field: $fieldName");
81+
82+
$this->assertSame($expected, $actual, "Mismatch for field: $fieldName");
8483
}
8584

8685
public static function providerGetRuleToValidField(): array {

0 commit comments

Comments
 (0)