mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Add HasTemporaryLocationFilter test and update filter parameters
A new test HasTemporaryLocationFilterTest has been added under ChillPersonBundle. This test mainly focuses on checking the filter functionalities related to temporary locations. In addition, the 'having_temporarily' parameter has been added to 'calc_date' field in HasTemporaryLocationFilter class.
This commit is contained in:
parent
ae7637acc6
commit
e2e0b08210
@ -70,7 +70,7 @@ class HasTemporaryLocationFilter implements FilterInterface
|
|||||||
},
|
},
|
||||||
])
|
])
|
||||||
->add('calc_date', PickRollingDateType::class, [
|
->add('calc_date', PickRollingDateType::class, [
|
||||||
'label' => 'export.filter.course.having_temporarily.Calculation date',
|
'label' => 'export.filter.course.having_temporarily.Calculation date', 'having_temporarily' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,67 @@
|
|||||||
|
<?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 Chill\PersonBundle\Tests\Export\Filter\AccompanyingCourseFilters;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
|
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||||
|
use Chill\MainBundle\Test\Export\AbstractFilterTest;
|
||||||
|
use Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\HasTemporaryLocationFilter;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* @coversNothing
|
||||||
|
*/
|
||||||
|
class HasTemporaryLocationFilterTest extends AbstractFilterTest
|
||||||
|
{
|
||||||
|
private RollingDateConverterInterface $rollingDateConverter;
|
||||||
|
|
||||||
|
protected function setUp(): void
|
||||||
|
{
|
||||||
|
self::bootKernel();
|
||||||
|
|
||||||
|
$this->rollingDateConverter = self::$container->get(RollingDateConverterInterface::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFilter()
|
||||||
|
{
|
||||||
|
return new HasTemporaryLocationFilter($this->rollingDateConverter);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFormData()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
[
|
||||||
|
'having_temporarily' => true,
|
||||||
|
'calc_date' => new RollingDate(RollingDate::T_TODAY),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'having_temporarily' => false,
|
||||||
|
'calc_date' => new RollingDate(RollingDate::T_TODAY),
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getQueryBuilders()
|
||||||
|
{
|
||||||
|
self::bootKernel();
|
||||||
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
|
return [
|
||||||
|
$em->createQueryBuilder()
|
||||||
|
->from('ChillPersonBundle:AccompanyingPeriod', 'acp')
|
||||||
|
->select('acp.id'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user