From e0de10b7a8af4e285128eb30210713e94a26e50f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 15 Nov 2023 16:34:08 +0100 Subject: [PATCH] Add tests for new exports calendar --- .../Export/Export/CountCalendarsTest.php | 55 +++++++++++++++++++ .../Export/StatCalendarAvgDurationTest.php | 55 +++++++++++++++++++ .../Export/StatCalendarSumDurationTest.php | 55 +++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 src/Bundle/ChillCalendarBundle/Tests/Export/Export/CountCalendarsTest.php create mode 100644 src/Bundle/ChillCalendarBundle/Tests/Export/Export/StatCalendarAvgDurationTest.php create mode 100644 src/Bundle/ChillCalendarBundle/Tests/Export/Export/StatCalendarSumDurationTest.php diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Export/CountCalendarsTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Export/CountCalendarsTest.php new file mode 100644 index 000000000..73ef2817c --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Export/CountCalendarsTest.php @@ -0,0 +1,55 @@ +get(CalendarRepository::class); + + yield new CountCalendarsLinkedToAcp($repository, $this->getParameters(true)); + yield new CountCalendarsLinkedToAcp($repository, $this->getParameters(false)); + + yield new CountCalendarsLinkedToPerson($repository, $this->getParameters(true)); + yield new CountCalendarsLinkedToPerson($repository, $this->getParameters(false)); + + } + + /** + * @inheritDoc + */ + public function getFormData() + { + return []; + } + + /** + * @inheritDoc + */ + public function getModifiersCombination() + { + return [ + [ + Declarations::CALENDAR_TYPE, + ]]; + } +} diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Export/StatCalendarAvgDurationTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Export/StatCalendarAvgDurationTest.php new file mode 100644 index 000000000..46b4e5226 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Export/StatCalendarAvgDurationTest.php @@ -0,0 +1,55 @@ +get(CalendarRepository::class); + + yield new StatCalendarAvgDurationLinkedToAcp($repository, $this->getParameters(true)); + yield new StatCalendarAvgDurationLinkedToAcp($repository, $this->getParameters(false)); + + yield new StatCalendarAvgDurationLinkedToPerson($repository, $this->getParameters(true)); + yield new StatCalendarAvgDurationLinkedToPerson($repository, $this->getParameters(false)); + + } + + /** + * @inheritDoc + */ + public function getFormData() + { + return []; + } + + /** + * @inheritDoc + */ + public function getModifiersCombination() + { + return [ + [ + Declarations::CALENDAR_TYPE, + ]]; + } +} diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Export/StatCalendarSumDurationTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Export/StatCalendarSumDurationTest.php new file mode 100644 index 000000000..d77f384c0 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Export/StatCalendarSumDurationTest.php @@ -0,0 +1,55 @@ +get(CalendarRepository::class); + + yield new StatCalendarSumDurationLinkedToAcp($repository, $this->getParameters(true)); + yield new StatCalendarSumDurationLinkedToAcp($repository, $this->getParameters(false)); + + yield new StatCalendarSumDurationLinkedToPerson($repository, $this->getParameters(true)); + yield new StatCalendarSumDurationLinkedToPerson($repository, $this->getParameters(false)); + + } + + /** + * @inheritDoc + */ + public function getFormData() + { + return []; + } + + /** + * @inheritDoc + */ + public function getModifiersCombination() + { + return [ + [ + Declarations::CALENDAR_TYPE, + ]]; + } +}