From 8421c2370c52432ec05792199e17fa29439a80e0 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Thu, 16 Jan 2025 16:48:12 +0000 Subject: [PATCH] Apply fixes from StyleCI --- tests/Unit/TimeUtilityTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Unit/TimeUtilityTest.php b/tests/Unit/TimeUtilityTest.php index 6cdb93097b5b..a025942cd7f0 100644 --- a/tests/Unit/TimeUtilityTest.php +++ b/tests/Unit/TimeUtilityTest.php @@ -20,15 +20,15 @@ public function testFormatInterval(): void $this->assertSame('1 minute', Time::formatInterval(60)); $this->assertSame('1 minute ago', Time::formatInterval(-60)); $this->assertSame('1m 1s', Time::formatInterval(61, true)); - $this->assertSame('1 hour', Time::formatInterval(60*60)); - $this->assertSame('1 day', Time::formatInterval(24*60*60)); - $this->assertSame('2 weeks 3 days 24 minutes 16 seconds', Time::formatInterval(17*24*60*60+1456)); - $this->assertSame('2 weeks 3 days', Time::formatInterval(17*24*60*60+1456, parts: 2)); + $this->assertSame('1 hour', Time::formatInterval(60 * 60)); + $this->assertSame('1 day', Time::formatInterval(24 * 60 * 60)); + $this->assertSame('2 weeks 3 days 24 minutes 16 seconds', Time::formatInterval(17 * 24 * 60 * 60 + 1456)); + $this->assertSame('2 weeks 3 days', Time::formatInterval(17 * 24 * 60 * 60 + 1456, parts: 2)); // different months could change this $this->travelTo(Carbon::createFromTimestamp(30042), function () { - $this->assertSame('1 month 1 week 2 days 24 minutes', Time::formatInterval(39*24*60*60+1456)); - $this->assertSame('1mo 1w 2d 24m 16s', Time::formatInterval(39*24*60*60+1456, true, 5)); + $this->assertSame('1 month 1 week 2 days 24 minutes', Time::formatInterval(39 * 24 * 60 * 60 + 1456)); + $this->assertSame('1mo 1w 2d 24m 16s', Time::formatInterval(39 * 24 * 60 * 60 + 1456, true, 5)); }); // calculate if there is a leap year (could freeze time, try this instead) @@ -38,9 +38,9 @@ public function testFormatInterval(): void $days = Carbon::now()->subYear()->isLeapYear() ? 366 : 365; } - $this->assertSame('1 year', Time::formatInterval($days*24*60*60)); - $this->assertSame('1 year ago', Time::formatInterval(-$days*24*60*60)); + $this->assertSame('1 year', Time::formatInterval($days * 24 * 60 * 60)); + $this->assertSame('1 year ago', Time::formatInterval(-$days * 24 * 60 * 60)); - $this->assertSame('4 years', Time::formatInterval(1461*24*60*60)); + $this->assertSame('4 years', Time::formatInterval(1461 * 24 * 60 * 60)); } }