Skip to content

Commit 5cf590b

Browse files
Merge branch '7.2' into 7.3
* 7.2: [Form] Skip windows x86 number transformer test cs fix
2 parents a1527cb + 7e29d58 commit 5cf590b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,10 @@ public static function eNotationProvider(): array
729729

730730
public function testReverseTransformDoesNotCauseIntegerPrecisionLoss()
731731
{
732+
if (\PHP_INT_SIZE === 4) {
733+
$this->markTestSkipped('Test is not applicable on 32-bit systems where no integer loses precision when cast to float.');
734+
}
735+
732736
$transformer = new NumberToLocalizedStringTransformer();
733737

734738
// Test a large integer that causes actual precision loss when cast to float
@@ -741,16 +745,20 @@ public function testReverseTransformDoesNotCauseIntegerPrecisionLoss()
741745

742746
public function testRoundMethodKeepsIntegersAsIntegers()
743747
{
748+
if (\PHP_INT_SIZE === 4) {
749+
$this->markTestSkipped('Test is not applicable on 32-bit systems where no integer loses precision when cast to float.');
750+
}
751+
744752
$transformer = new NumberToLocalizedStringTransformer(2); // scale=2 triggers rounding
745-
753+
746754
// Use reflection to test the private round() method directly
747755
$reflection = new \ReflectionClass($transformer);
748756
$roundMethod = $reflection->getMethod('round');
749757
$roundMethod->setAccessible(true);
750-
758+
751759
$int = \PHP_INT_MAX - 1;
752760
$result = $roundMethod->invoke($transformer, $int);
753-
761+
754762
// With the fix, integers should stay as integers, not be converted to floats
755763
$this->assertSame($int, $result);
756764
$this->assertIsInt($result);

0 commit comments

Comments
 (0)