@@ -732,7 +732,7 @@ public function testReverseTransformDoesNotCauseIntegerPrecisionLoss()
732
732
$ this ->markTestSkipped ('Test is not applicable on 32-bit systems where no integer loses precision when cast to float. ' );
733
733
}
734
734
735
- $ transformer = new NumberToLocalizedStringTransformer ();
735
+ $ transformer = new NumberToLocalizedStringTransformer (2 );
736
736
737
737
// Test a large integer that causes actual precision loss when cast to float
738
738
$ largeInt = \PHP_INT_MAX - 1 ; // This value loses precision when cast to float
@@ -741,24 +741,4 @@ public function testReverseTransformDoesNotCauseIntegerPrecisionLoss()
741
741
$ this ->assertSame ($ largeInt , $ result );
742
742
$ this ->assertIsInt ($ result );
743
743
}
744
-
745
- public function testRoundMethodKeepsIntegersAsIntegers ()
746
- {
747
- if (\PHP_INT_SIZE === 4 ) {
748
- $ this ->markTestSkipped ('Test is not applicable on 32-bit systems where no integer loses precision when cast to float. ' );
749
- }
750
-
751
- $ transformer = new NumberToLocalizedStringTransformer (2 ); // scale=2 triggers rounding
752
-
753
- // Use reflection to test the private round() method directly
754
- $ reflection = new \ReflectionClass ($ transformer );
755
- $ roundMethod = $ reflection ->getMethod ('round ' );
756
-
757
- $ int = \PHP_INT_MAX - 1 ;
758
- $ result = $ roundMethod ->invoke ($ transformer , $ int );
759
-
760
- // With the fix, integers should stay as integers, not be converted to floats
761
- $ this ->assertSame ($ int , $ result );
762
- $ this ->assertIsInt ($ result );
763
- }
764
744
}
0 commit comments