File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Tests/Extension/Core/DataTransformer Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments