]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
UT: fix formatting issue when the current day has a single digit 1618/head
authorArthurHoaro <arthur@hoa.ro>
Mon, 2 Nov 2020 18:22:50 +0000 (19:22 +0100)
committerArthurHoaro <arthur@hoa.ro>
Mon, 2 Nov 2020 18:32:48 +0000 (19:32 +0100)
tests/front/controller/visitor/DailyControllerTest.php
tests/helper/DailyPageHelperTest.php

index 758e7219a4b5bdc7211140d4339ed28713c38c94..70fbce5482d75ff9beef4c423dfb3d3e52de094e 100644 (file)
@@ -327,7 +327,7 @@ class DailyControllerTest extends TestCase
         static::assertSame(200, $result->getStatusCode());
         static::assertSame('daily', (string) $result->getBody());
         static::assertCount(0, $assignedVariables['linksToDisplay']);
-        static::assertSame('Today - ' . (new \DateTime())->format('F d, Y'), $assignedVariables['dayDesc']);
+        static::assertSame('Today - ' . (new \DateTime())->format('F j, Y'), $assignedVariables['dayDesc']);
         static::assertEquals((new \DateTime())->setTime(0, 0)->getTimestamp(), $assignedVariables['day']);
         static::assertEquals((new \DateTime())->setTime(0, 0), $assignedVariables['dayDate']);
     }
index e03784915e1914653d833b405e55bc06b8f37374..5255b7b16db55e0afa388e14c319bf02612eede3 100644 (file)
@@ -240,8 +240,8 @@ class DailyPageHelperTest extends TestCase
     public function getDescriptionsByType(): array
     {
         return [
-            [DailyPageHelper::DAY, $date = new \DateTimeImmutable(), 'Today - ' . $date->format('F d, Y')],
-            [DailyPageHelper::DAY, $date = new \DateTimeImmutable('-1 day'), 'Yesterday - ' . $date->format('F d, Y')],
+            [DailyPageHelper::DAY, $date = new \DateTimeImmutable(), 'Today - ' . $date->format('F j, Y')],
+            [DailyPageHelper::DAY, $date = new \DateTimeImmutable('-1 day'), 'Yesterday - ' . $date->format('F j, Y')],
             [DailyPageHelper::DAY, new \DateTimeImmutable('2020-10-09 04:05:06'), 'October 9, 2020'],
             [DailyPageHelper::WEEK, new \DateTimeImmutable('2020-10-09 04:05:06'), 'Week 41 (October 5, 2020)'],
             [DailyPageHelper::MONTH, new \DateTimeImmutable('2020-10-09 04:05:06'), 'October, 2020'],