mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 18:43:49 +00:00
fix tests implementing AbstractFilterTest
This commit is contained in:
@@ -63,9 +63,7 @@ final class BetweenDatesFilterTest extends AbstractFilterTest
|
||||
|
||||
public function getQueryBuilders(): array
|
||||
{
|
||||
if (null === self::$kernel) {
|
||||
self::bootKernel();
|
||||
}
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
|
@@ -50,32 +50,24 @@ final class JobFilterTest extends AbstractFilterTest
|
||||
return $this->filter;
|
||||
}
|
||||
|
||||
public function getFormData(): array
|
||||
public function getFormData(): iterable
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
$array = $em->createQueryBuilder()
|
||||
->from(UserJob::class, 'uj')
|
||||
->select('uj')
|
||||
->getQuery()
|
||||
->setMaxResults(1)
|
||||
->getResult();
|
||||
|
||||
$data = [];
|
||||
|
||||
foreach ($array as $a) {
|
||||
$data[] = [
|
||||
'job' => $a,
|
||||
];
|
||||
}
|
||||
|
||||
return $data;
|
||||
yield ['job' => $array];
|
||||
}
|
||||
|
||||
public function getQueryBuilders(): array
|
||||
{
|
||||
if (null === self::$kernel) {
|
||||
self::bootKernel();
|
||||
}
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
@@ -83,7 +75,6 @@ final class JobFilterTest extends AbstractFilterTest
|
||||
$em->createQueryBuilder()
|
||||
->select('cal.id')
|
||||
->from(Calendar::class, 'cal')
|
||||
->join('cal.user', 'caluser'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -52,12 +52,14 @@ final class ScopeFilterTest extends AbstractFilterTest
|
||||
|
||||
public function getFormData(): array
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
$array = $em->createQueryBuilder()
|
||||
->from(Scope::class, 's')
|
||||
->select('s')
|
||||
->getQuery()
|
||||
->setMaxResults(1)
|
||||
->getResult();
|
||||
|
||||
$data = [];
|
||||
@@ -73,9 +75,7 @@ final class ScopeFilterTest extends AbstractFilterTest
|
||||
|
||||
public function getQueryBuilders(): array
|
||||
{
|
||||
if (null === self::$kernel) {
|
||||
self::bootKernel();
|
||||
}
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
@@ -83,7 +83,6 @@ final class ScopeFilterTest extends AbstractFilterTest
|
||||
$em->createQueryBuilder()
|
||||
->select('cal.id')
|
||||
->from(Calendar::class, 'cal')
|
||||
->join('cal.user', 'caluser'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user