Skip to content

Commit

Permalink
Fix micro-second approximation test
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Oct 8, 2024
1 parent 37a7dd4 commit 9a48a13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/CarbonInterval/ConstructTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public function testFromSerialization()
$today = new Carbon('today');
$interval = $today->diffAsCarbonInterval($past);
/** @var CarbonInterval $copy */
$copy = unserialize(serialize($interval));
$copy = unserialize(serialize($interval));

$this->assertInstanceOf(CarbonInterval::class, $copy);

Expand All @@ -454,7 +454,7 @@ public function testFromSerialization()

$interval = $today->locale('ja')->diffAsCarbonInterval($past);
/** @var CarbonInterval $copy */
$copy = unserialize(serialize($interval));
$copy = unserialize(serialize($interval));

$this->assertInstanceOf(CarbonInterval::class, $copy);

Expand Down Expand Up @@ -483,7 +483,7 @@ private function assertSameIntervals(CarbonInterval $expected, CarbonInterval $a
$expected->microseconds !== $actual->microseconds
&& $microsecondApproximation > 0
&& $actual->microseconds >= $expected->microseconds - $microsecondApproximation
&& $actual->microseconds <= $expected->microseconds - $microsecondApproximation
&& $actual->microseconds <= $expected->microseconds + $microsecondApproximation
) {
$actual->microseconds = $expected->microseconds;
}
Expand Down

0 comments on commit 9a48a13

Please sign in to comment.