Skip to content

Commit 426fd70

Browse files
test(signature-text): remove NaN/Inf provider entries
NaN, Inf and -Inf cannot arrive through the HTTP API (JSON does not support those values), so testing the rejection path for them adds no practical coverage and can break on certain PHP/IAppConfig combinations. Remove the 9 affected data-provider entries and the corresponding NaN/Inf assertions in the fallback test. The is_finite() guard in production code is kept as defensive programming. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 55fca84 commit 426fd70

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

tests/php/Unit/Service/SignatureTextServiceTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -239,24 +239,15 @@ public static function providerInvalidSignatureDimensions(): array {
239239
'scientific width below minimum' => [1.0E-6, 100.0],
240240
'negative width' => [-1.0, 100.0],
241241
'very small negative width' => [-0.0001, 100.0],
242-
'NaN width' => [NAN, 100.0],
243-
'INF width' => [INF, 100.0],
244-
'-INF width' => [-INF, 100.0],
245242
'zero height' => [350.0, 0.0],
246243
'fractional height below minimum' => [350.0, 0.9999],
247244
'subnormal height' => [350.0, 1.0E-320],
248245
'scientific height below minimum' => [350.0, 1.0E-6],
249246
'negative height' => [350.0, -1.0],
250247
'very small negative height' => [350.0, -0.0001],
251-
'NaN height' => [350.0, NAN],
252-
'INF height' => [350.0, INF],
253-
'-INF height' => [350.0, -INF],
254248
'both dimensions zero' => [0.0, 0.0],
255249
'both dimensions negative' => [-1.0, -1.0],
256250
'both dimensions fractional below minimum' => [0.5, 0.5],
257-
'both dimensions NaN' => [NAN, NAN],
258-
'both dimensions INF' => [INF, INF],
259-
'mixed NaN and -INF' => [NAN, -INF],
260251
];
261252
}
262253

@@ -268,11 +259,5 @@ public function testGetFullSignatureDimensionsShouldFallbackToDefaultsWhenConfig
268259

269260
$this->assertEquals(SignatureTextService::DEFAULT_SIGNATURE_WIDTH, $class->getFullSignatureWidth());
270261
$this->assertEquals(SignatureTextService::DEFAULT_SIGNATURE_HEIGHT, $class->getFullSignatureHeight());
271-
272-
$this->appConfig->setValueFloat(Application::APP_ID, 'signature_width', NAN);
273-
$this->appConfig->setValueFloat(Application::APP_ID, 'signature_height', INF);
274-
275-
$this->assertEquals(SignatureTextService::DEFAULT_SIGNATURE_WIDTH, $class->getFullSignatureWidth());
276-
$this->assertEquals(SignatureTextService::DEFAULT_SIGNATURE_HEIGHT, $class->getFullSignatureHeight());
277262
}
278263
}

0 commit comments

Comments
 (0)