From f103b228e42889c1dcda0c406287c65d16f4bac3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 18 Dec 2023 17:04:42 +0100 Subject: [PATCH] Create test for the participationBetweenDatesFilter --- ...ithParticipationBetweenDatesFilterTest.php | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilterTest.php diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilterTest.php new file mode 100644 index 000000000..bbca0e8bb --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilterTest.php @@ -0,0 +1,58 @@ +filter = self::$container->get(WithParticipationBetweenDatesFilter::class); + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData() + { + return [ + [ + 'date_after' => new RollingDate(RollingDate::T_YEAR_CURRENT_START), + 'date_before' => new RollingDate(RollingDate::T_TODAY), + ], + ]; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders() + { + self::bootKernel(); + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->select('person.id') + ->from(Person::class, 'person'), + ]; + } +}