diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php index ca5ccaf27..3313cb23f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php @@ -70,7 +70,7 @@ class HasTemporaryLocationFilter implements FilterInterface }, ]) ->add('calc_date', PickRollingDateType::class, [ - 'label' => 'export.filter.course.having_temporarily.Calculation date', + 'label' => 'export.filter.course.having_temporarily.Calculation date', 'having_temporarily' => true, ]); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilterTest.php new file mode 100644 index 000000000..5c1b8b9c7 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilterTest.php @@ -0,0 +1,67 @@ +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'), + ]; + } +}