From ea12c601543f7a6b744c22729e3fa1899ccf630f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 2 Aug 2022 12:31:29 +0200 Subject: [PATCH] more aggregator tests --- .../Aggregator/ActionTypeAggregatorTest.php | 58 +++++++++++++++++++ .../Export/Aggregator/GoalAggregatorTest.php | 58 +++++++++++++++++++ .../Aggregator/ResultAggregatorTest.php | 58 +++++++++++++++++++ 3 files changed, 174 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ActionTypeAggregatorTest.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/GoalAggregatorTest.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ResultAggregatorTest.php diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ActionTypeAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ActionTypeAggregatorTest.php new file mode 100644 index 000000000..1f5585281 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ActionTypeAggregatorTest.php @@ -0,0 +1,58 @@ +aggregator = self::$container->get('chill.person.export.aggregator_action_type'); + } + + public function getAggregator() + { + return $this->aggregator; + } + + public function getFormData() + { + return [ + [], + ]; + } + + public function getQueryBuilders() + { + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container + ->get('doctrine.orm.entity_manager'); + + return [ + $em->createQueryBuilder() + ->select('count(acpw.id)') + ->from('ChillPersonBundle:AccompanyingPeriodWork', 'acpw'), + ]; + } +} diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/GoalAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/GoalAggregatorTest.php new file mode 100644 index 000000000..ca1fa9417 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/GoalAggregatorTest.php @@ -0,0 +1,58 @@ +aggregator = self::$container->get('chill.person.export.aggregator_goal'); + } + + public function getAggregator() + { + return $this->aggregator; + } + + public function getFormData() + { + return [ + [], + ]; + } + + public function getQueryBuilders() + { + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container + ->get('doctrine.orm.entity_manager'); + + return [ + $em->createQueryBuilder() + ->select('count(acpw.id)') + ->from('ChillPersonBundle:AccompanyingPeriodWork', 'acpw'), + ]; + } +} diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ResultAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ResultAggregatorTest.php new file mode 100644 index 000000000..f5080e488 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ResultAggregatorTest.php @@ -0,0 +1,58 @@ +aggregator = self::$container->get('chill.person.export.aggregator_result'); + } + + public function getAggregator() + { + return $this->aggregator; + } + + public function getFormData() + { + return [ + [], + ]; + } + + public function getQueryBuilders() + { + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container + ->get('doctrine.orm.entity_manager'); + + return [ + $em->createQueryBuilder() + ->select('count(acpw.id)') + ->from('ChillPersonBundle:AccompanyingPeriodWork', 'acpw'), + ]; + } +}