diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ActiveOnDateFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ActiveOnDateFilterTest.php new file mode 100644 index 000000000..b66de0f28 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ActiveOnDateFilterTest.php @@ -0,0 +1,65 @@ +prophesize(); + + $request->willExtend(Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_activeondate'); + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + return [ + [ + 'on_date' => \DateTime::createFromFormat('Y-m-d', '2022-05-01'), + ], + ]; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders(): array + { + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp') + ->select('acp.id'), + ]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ActiveOneDayBetweenDatesFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ActiveOneDayBetweenDatesFilterTest.php new file mode 100644 index 000000000..051db8635 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ActiveOneDayBetweenDatesFilterTest.php @@ -0,0 +1,66 @@ +prophesize(); + + $request->willExtend(Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_activeonedaybetweendates'); + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + return [ + [ + 'date_from' => \DateTime::createFromFormat('Y-m-d', '2022-05-01'), + 'date_to' => \DateTime::createFromFormat('Y-m-d', '2022-06-01'), + ], + ]; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders(): array + { + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp') + ->select('acp.id'), + ]; + } +} \ No newline at end of file