From f8f04c69d0154e76731c4bd1881398e30d6ed2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 1 Sep 2023 13:36:07 +0200 Subject: [PATCH] Remove test which seems to be not up to date with filter --- .../SocialWorkTypeFilterTest.php | 105 ------------------ 1 file changed, 105 deletions(-) delete mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/SocialWorkTypeFilterTest.php diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/SocialWorkTypeFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/SocialWorkTypeFilterTest.php deleted file mode 100644 index 5287ab844..000000000 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/SocialWorkTypeFilterTest.php +++ /dev/null @@ -1,105 +0,0 @@ -filter = self::$container->get('chill.person.export.filter_social_work_type'); - } - - public function getFilter() - { - return $this->filter; - } - - public function getFormData(): array - { - $action_repository = self::$container->get(SocialActionRepository::class); - $goal_repository = self::$container->get(GoalRepository::class); - $result_repository = self::$container->get(ResultRepository::class); - - $actions = []; - $goals = []; - $results = []; - - $social_actions = $action_repository->findAll(); - - foreach ($social_actions as $action) { - $actions[] = $action->getId(); - $goals_by_action = $goal_repository->findBySocialActionWithDescendants($action); - - foreach ($goals_by_action as $goal) { - $goals[] = $goal->getId(); - $results_by_goal = $result_repository->findByGoal($goal); - - foreach ($results_by_goal as $result) { - $results[] = $result->getId(); - } - } - $results_by_action = $result_repository->findBySocialActionWithDescendants($action); - - foreach ($results_by_action as $result) { - $results[] = $result->getId(); - } - } - - sort($actions); - sort($goals); - sort($results); - - $actions = array_unique($actions); - $goals = array_unique($goals); - $results = array_unique($results); - - return [ - [ - 'actionType' => implode(',', $actions), - 'goal' => implode(',', $goals), - 'result' => implode(',', $results), - ], - ]; - } - - public function getQueryBuilders(): array - { - if (null === self::$kernel) { - self::bootKernel(); - } - - $em = self::$container->get(EntityManagerInterface::class); - - return [ - $em->createQueryBuilder() - ->select('acpw.id') - ->from(AccompanyingPeriod::class, 'acp') - ->join('acp.works', 'acpw'), - ]; - } -}