From 684f1a30158b2b3c625108c428788d2101a05bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 29 Nov 2023 16:15:40 +0100 Subject: [PATCH] Fix ci issues --- .../Controller/NewsItemApiController.php | 6 +++--- .../Repository/NewsItemRepository.php | 2 +- .../Tests/Dashboard/NewsItemControllerTest.php | 10 +++++++++- .../Tests/Dashboard/NewsItemRepositoryTest.php | 15 ++++++++++++--- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php b/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php index a44bcf989..c4476a041 100644 --- a/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php @@ -22,9 +22,9 @@ use Symfony\Component\Serializer\SerializerInterface; class NewsItemApiController { public function __construct( - private NewsItemRepository $newsItemRepository, - private SerializerInterface $serializer, - private PaginatorFactory $paginatorFactory + private readonly NewsItemRepository $newsItemRepository, + private readonly SerializerInterface $serializer, + private readonly PaginatorFactory $paginatorFactory ) {} /** diff --git a/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php b/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php index 3e918dfd1..6787e78bd 100644 --- a/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php @@ -22,7 +22,7 @@ class NewsItemRepository implements ObjectRepository { private readonly EntityRepository $repository; - public function __construct(EntityManagerInterface $entityManager, private ClockInterface $clock) + public function __construct(EntityManagerInterface $entityManager, private readonly ClockInterface $clock) { $this->repository = $entityManager->getRepository(NewsItem::class); } diff --git a/src/Bundle/ChillMainBundle/Tests/Dashboard/NewsItemControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Dashboard/NewsItemControllerTest.php index 8809138a2..bbbd354e6 100644 --- a/src/Bundle/ChillMainBundle/Tests/Dashboard/NewsItemControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Dashboard/NewsItemControllerTest.php @@ -1,5 +1,14 @@ newsItemRepository = self::$container->get(NewsItemRepository::class); } + /** + * @doesNotPerformAssertions + */ public function testFindWithDateFilter(): void { $clock = new MockClock('2023-11-20'); @@ -44,7 +55,5 @@ class NewsItemRepositoryTest extends KernelTestCase $newsItemC->setContent('tralala'); $newsItemC->setStartDate(new \DateTime('2023-11-03')); $newsItemC->setEndDate(null); - } - }