Fix ci issues

This commit is contained in:
Julien Fastré 2023-11-29 16:15:40 +01:00
parent 2af9ff7d00
commit 684f1a3015
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
4 changed files with 25 additions and 8 deletions

View File

@ -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
) {}
/**

View File

@ -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);
}

View File

@ -1,5 +1,14 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Dashboard;
use Chill\MainBundle\Test\PrepareClientTrait;
@ -32,5 +41,4 @@ class NewsItemControllerTest extends WebTestCase
self::assertResponseIsSuccessful();
}
}

View File

@ -1,10 +1,18 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Dashboard;
use Chill\MainBundle\Entity\NewsItem;
use Chill\MainBundle\Repository\NewsItemRepository;
use Chill\MainBundle\Test\PrepareClientTrait;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Clock\MockClock;
@ -24,6 +32,9 @@ class NewsItemRepositoryTest extends KernelTestCase
$this->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);
}
}