mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-31 03:53:49 +00:00
upgrade phpunit: make data provider static
This commit is contained in:
@@ -124,7 +124,7 @@ class AccompanyingPeriodContextTest extends KernelTestCase
|
||||
call_user_func($assertionsOnData, $data);
|
||||
}
|
||||
|
||||
public function provideNormalizedData(): iterable
|
||||
public static function provideNormalizedData(): iterable
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
@@ -115,7 +115,7 @@ final class PersonContextTest extends KernelTestCase
|
||||
call_user_func($assertionsOnData, $data);
|
||||
}
|
||||
|
||||
public function provideNormalizedData(): iterable
|
||||
public static function provideNormalizedData(): iterable
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
@@ -99,11 +99,12 @@ class AccompanyingPeriodCalendarGenericDocProviderTest extends KernelTestCase
|
||||
self::assertStringContainsStringIgnoringCase('TRUE = FALSE', $sql);
|
||||
}
|
||||
|
||||
public function provideDataForPerson(): iterable
|
||||
public static function provideDataForPerson(): iterable
|
||||
{
|
||||
$this->setUp();
|
||||
self::bootKernel();
|
||||
$entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
if (null === $person = $this->entityManager->createQuery('SELECT p FROM '.Person::class.' p WHERE SIZE(p.accompanyingPeriodParticipations) > 0')
|
||||
if (null === $person = $entityManager->createQuery('SELECT p FROM '.Person::class.' p WHERE SIZE(p.accompanyingPeriodParticipations) > 0')
|
||||
->setMaxResults(1)->getSingleResult()) {
|
||||
throw new \RuntimeException('There is no person');
|
||||
}
|
||||
@@ -116,11 +117,12 @@ class AccompanyingPeriodCalendarGenericDocProviderTest extends KernelTestCase
|
||||
yield [$person, null, new \DateTimeImmutable('6 month ago'), null];
|
||||
}
|
||||
|
||||
public function provideDataForAccompanyingPeriod(): iterable
|
||||
public static function provideDataForAccompanyingPeriod(): iterable
|
||||
{
|
||||
$this->setUp();
|
||||
self::bootKernel();
|
||||
$entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
if (null === $period = $this->entityManager->createQuery('SELECT p FROM '.AccompanyingPeriod::class.' p ')
|
||||
if (null === $period = $entityManager->createQuery('SELECT p FROM '.AccompanyingPeriod::class.' p ')
|
||||
->setMaxResults(1)->getSingleResult()) {
|
||||
throw new \RuntimeException('There is no accompanying period');
|
||||
}
|
||||
|
@@ -70,7 +70,7 @@ class AccompanyingPeriodWorkEvaluationGenericDocProviderTest extends KernelTestC
|
||||
self::assertIsInt($nb, 'Test that there are no errors');
|
||||
}
|
||||
|
||||
public function provideSearchArguments(): iterable
|
||||
public static function provideSearchArguments(): iterable
|
||||
{
|
||||
yield [null, null, null];
|
||||
yield [new \DateTimeImmutable('1 month ago'), null, null];
|
||||
|
@@ -52,11 +52,12 @@ class PersonCalendarGenericDocProviderTest extends KernelTestCase
|
||||
self::assertIsInt($nb);
|
||||
}
|
||||
|
||||
public function provideDataForPerson(): iterable
|
||||
public static function provideDataForPerson(): iterable
|
||||
{
|
||||
$this->setUp();
|
||||
self::bootKernel();
|
||||
$entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
if (null === $person = $this->entityManager->createQuery('SELECT p FROM '.Person::class.' p ')
|
||||
if (null === $person = $entityManager->createQuery('SELECT p FROM '.Person::class.' p ')
|
||||
->setMaxResults(1)->getSingleResult()) {
|
||||
throw new \RuntimeException('There is no person');
|
||||
}
|
||||
|
Reference in New Issue
Block a user