diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/ReferrerAggregator.php index 3dbc4b820..91e181012 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/ReferrerAggregator.php @@ -13,13 +13,9 @@ namespace Chill\PersonBundle\Export\Aggregator; use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Repository\UserRepository; -use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Export\Declarations; -use Doctrine\ORM\EntityRepository; use Doctrine\ORM\QueryBuilder; -use LogicException; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Contracts\Translation\TranslatorInterface; final class ReferrerAggregator implements AggregatorInterface { @@ -62,7 +58,6 @@ final class ReferrerAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - dump($values); return function ($value): string { if ('_header' === $value) { return 'Referrer'; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ReferrerAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ReferrerAggregatorTest.php new file mode 100644 index 000000000..f1aa07190 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/ReferrerAggregatorTest.php @@ -0,0 +1,58 @@ +aggregator = self::$container->get('chill.person.export.aggregator_referrer'); + } + + 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/Export/CountSocialWorkActionsTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountSocialWorkActionsTest.php new file mode 100644 index 000000000..d904f2eeb --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountSocialWorkActionsTest.php @@ -0,0 +1,43 @@ +export = self::$container->get('chill.person.export.count_social_work_actions'); + } + + /** + * @inheritDoc + */ + public function getExport() + { + return $this->export; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + return [[]]; + } + + /** + * @inheritDoc + */ + public function getModifiersCombination() + { + return [[Declarations::SOCIAL_WORK_ACTION_TYPE]]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/JobFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/JobFilterTest.php new file mode 100644 index 000000000..6f7546b4b --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/JobFilterTest.php @@ -0,0 +1,60 @@ +prophesize(); + + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_job'); + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + return []; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders(): array + { + + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->select('acpw.id') + ->from('ChillPersonBundle:AccompanyingPeriodWork', 'acpw'), + ]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ScopeFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ScopeFilterTest.php new file mode 100644 index 000000000..d387769cc --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ScopeFilterTest.php @@ -0,0 +1,61 @@ +prophesize(); + + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_scope'); + + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + return []; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders(): array + { + + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->select('acpw.id') + ->from('ChillPersonBundle:AccompanyingPeriodWork', 'acpw'), + ]; + } +} \ No newline at end of file