From 232cf96cb2ab5f579c2804690344f8499ef00f10 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 27 Jul 2022 10:39:09 +0200 Subject: [PATCH 1/5] tests: write a simple Filter test for EmergencyFilter --- .../Export/Filter/EmergencyFilterTest.php | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php new file mode 100644 index 000000000..80b4be149 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php @@ -0,0 +1,55 @@ +prophesize(); + + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_emergency'); + } + + public function getFilter() + { + return $this->filter; + } + + public function getFormData() + { + return [ + ['accepted_emergencies' => true], + ['accepted_emergencies' => false] + ]; + } + + public function getQueryBuilders() + { + + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get('doctrine.orm.entity_manager'); + + return [ + $em->createQueryBuilder() + ->select('acp.id') + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp'), + ]; + } +} \ No newline at end of file From 3dabd031f4b04d5c37321676b43342a25478acaf Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 26 Jul 2022 20:42:35 +0200 Subject: [PATCH 2/5] fix tests failed in exports --- .../ChillMainBundle/Test/Export/AbstractAggregatorTest.php | 1 + src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php | 3 +++ .../ChillPersonBundle/Tests/Export/Export/CountPersonTest.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php index 1a91d4629..cf5fe5c31 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php @@ -166,6 +166,7 @@ abstract class AbstractAggregatorTest extends KernelTestCase $this->assertContainsOnly( 'string', $queryKeys, + true, 'test that the query keys returned by `getQueryKeys` are only strings' ); $this->assertGreaterThanOrEqual( diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php index d7da05aa7..a80753a46 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php @@ -140,6 +140,7 @@ abstract class AbstractExportTest extends WebTestCase $this->assertContainsOnly( 'string', $formattersTypes, + true, 'Test that the method `getAllowedFormattersTypes` returns an array of string' ); } @@ -174,6 +175,7 @@ abstract class AbstractExportTest extends WebTestCase $this->assertContainsOnly( 'string', $queryKeys, + true, 'test that the query keys returned by `getQueryKeys` are only strings' ); $this->assertGreaterThanOrEqual( @@ -395,6 +397,7 @@ abstract class AbstractExportTest extends WebTestCase $this->assertContainsOnly( 'string', $export->supportsModifiers(), + true, 'Test that the `supportsModifiers` method returns only strings' ); } elseif ($query instanceof NativeQuery) { diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonTest.php index 831de2933..fe7d91753 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonTest.php @@ -30,7 +30,7 @@ final class CountPersonTest extends AbstractExportTest { self::bootKernel(); - $this->export = self::$container->get('chill.person.export.export_count_person'); + $this->export = self::$container->get('chill.person.export.count_person'); } public function getExport() From 8bbca124879adb93e11b186eaec9651a8fc067c1 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 27 Jul 2022 12:11:51 +0200 Subject: [PATCH 3/5] fix ProphecyTrait in AbstractFilter to use it with each filter --- .../ChillMainBundle/Test/Export/AbstractFilterTest.php | 7 +++++-- .../Tests/Export/Filter/EmergencyFilterTest.php | 4 +--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php index 4355687e1..34869c30b 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php @@ -13,6 +13,7 @@ namespace Chill\MainBundle\Test\Export; use Doctrine\ORM\QueryBuilder; use Exception; +use Prophecy\PhpUnit\ProphecyTrait; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use function count; @@ -27,14 +28,16 @@ use function is_string; */ abstract class AbstractFilterTest extends KernelTestCase { + use ProphecyTrait; + /** * @var \Prophecy\Prophet */ - protected $prophet; + private $prophet; protected function setUp(): void { - $this->prepareProphet(); + $$this->prophet = $this->getProphet(); } public function dataProviderAlterQuery() diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php index 80b4be149..0a0f2ae86 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php @@ -14,11 +14,9 @@ class EmergencyFilterTest extends AbstractFilterTest self::bootKernel(); // add a fake request with a default locale (used in translatable string) - $prophet = new \Prophecy\Prophet(); - $request = $prophet->prophesize(); + $request = $this->prophesize(); $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); - $request->getLocale()->willReturn('fr'); $this->filter = self::$container->get('chill.person.export.filter_emergency'); From 287d8f546b26e99b4d83b3fcdf9b0eb4d68c2260 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 26 Jul 2022 17:53:53 +0200 Subject: [PATCH 4/5] add simple test file for each new filter --- .../Export/Filter/ClosingMotiveFilterTest.php | 75 +++++++++++++++++ .../Export/Filter/ConfidentialFilterTest.php | 63 ++++++++++++++ .../Export/Filter/EmergencyFilterTest.php | 7 +- .../Export/Filter/IntensityFilterTest.php | 63 ++++++++++++++ .../Tests/Export/Filter/OriginFilterTest.php | 75 +++++++++++++++++ .../Export/Filter/SocialIssueFilterTest.php | 82 +++++++++++-------- .../Tests/Export/Filter/StepFilterTest.php | 64 +++++++++++++++ .../Tests/Export/Filter/UserJobFilterTest.php | 60 ++++++++++++++ .../Export/Filter/UserScopeFilterTest.php | 61 ++++++++++++++ 9 files changed, 512 insertions(+), 38 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/ClosingMotiveFilterTest.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/ConfidentialFilterTest.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/IntensityFilterTest.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/OriginFilterTest.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/StepFilterTest.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/UserJobFilterTest.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Filter/UserScopeFilterTest.php diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ClosingMotiveFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ClosingMotiveFilterTest.php new file mode 100644 index 000000000..cbfa1c306 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ClosingMotiveFilterTest.php @@ -0,0 +1,75 @@ +prophesize(); + + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_closingmotive'); + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + $em = self::$container->get(EntityManagerInterface::class); + + $array = $em->createQueryBuilder() + ->from(ClosingMotive::class, 'm') + ->select('m') + ->getQuery() + ->getResult(); + + $data = []; + + foreach($array as $m) { + $data[] = ['accepted_closingmotives' => $m]; + } + + return $data; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders(): array + { + + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->select('acp.id') + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp'), + ]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ConfidentialFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ConfidentialFilterTest.php new file mode 100644 index 000000000..1d8573916 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/ConfidentialFilterTest.php @@ -0,0 +1,63 @@ +prophesize(); + + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_confidential'); + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + return [ + ['accepted_confidentials' => true], + ['accepted_confidentials' => false] + ]; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders(): array + { + + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->select('acp.id') + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp'), + ]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php index 0a0f2ae86..0533a604a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EmergencyFilterTest.php @@ -4,6 +4,7 @@ namespace Chill\PersonBundle\Tests\Export\Filter; use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\PersonBundle\Export\Filter\EmergencyFilter; +use Doctrine\ORM\EntityManagerInterface; class EmergencyFilterTest extends AbstractFilterTest { @@ -27,7 +28,7 @@ class EmergencyFilterTest extends AbstractFilterTest return $this->filter; } - public function getFormData() + public function getFormData(): array { return [ ['accepted_emergencies' => true], @@ -35,14 +36,14 @@ class EmergencyFilterTest extends AbstractFilterTest ]; } - public function getQueryBuilders() + public function getQueryBuilders(): array { if (null === self::$kernel) { self::bootKernel(); } - $em = self::$container->get('doctrine.orm.entity_manager'); + $em = self::$container->get(EntityManagerInterface::class); return [ $em->createQueryBuilder() diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/IntensityFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/IntensityFilterTest.php new file mode 100644 index 000000000..c39602cf8 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/IntensityFilterTest.php @@ -0,0 +1,63 @@ +prophesize(); + + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_intensity'); + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + return [ + ['accepted_intensities' => 'occasional'], + ['accepted_intensities' => 'regular'] + ]; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders(): array + { + + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->select('acp.id') + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp'), + ]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/OriginFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/OriginFilterTest.php new file mode 100644 index 000000000..7aa1f1c7a --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/OriginFilterTest.php @@ -0,0 +1,75 @@ +prophesize(); + + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_origin'); + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + $em = self::$container->get(EntityManagerInterface::class); + + $array = $em->createQueryBuilder() + ->from(Origin::class, 'o') + ->select('o') + ->getQuery() + ->getResult(); + + $data = []; + + foreach($array as $l) { + $data[] = ['accepted_origins' => $l]; + } + + return $data; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders(): array + { + + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->select('acp.id') + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp'), + ]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialIssueFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialIssueFilterTest.php index ed520e90b..ac092884b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialIssueFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialIssueFilterTest.php @@ -1,63 +1,75 @@ filter = self::$container->get('chill.person.export.filter_socialissue'); - } catch (ServiceNotFoundException $e) { - $this->markTestSkipped('Filter service is not found'); - } + // add a fake request with a default locale (used in translatable string) + $request = $this->prophesize(); + + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_socialissue'); } + /** + * @inheritDoc + */ public function getFilter() { return $this->filter; } - public function getFormData() + /** + * @inheritDoc + */ + public function getFormData(): array { - return [ - ['accepted_socialissue' => [ + $em = self::$container->get(EntityManagerInterface::class); - ]], - ['accepted_socialissue' => [ + $array = $em->createQueryBuilder() + ->from(SocialIssue::class, 'si') + ->select('si') + ->getQuery() + ->getResult(); - ]], - ['accepted_socialissue' => [ + $data = []; - ]], - ]; + foreach($array as $i) { + $data[] = ['accepted_socialissues' => $i]; + } + + return $data; } - public function getQueryBuilders() + /** + * @inheritDoc + */ + public function getQueryBuilders(): array { - // TODO: Implement getQueryBuilders() method. - } + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get(EntityManagerInterface::class); + + return [ + $em->createQueryBuilder() + ->select('acp.id') + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp'), + ]; + } } \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/StepFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/StepFilterTest.php new file mode 100644 index 000000000..1a8dfd2ff --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/StepFilterTest.php @@ -0,0 +1,64 @@ +prophesize(); + + $request->willExtend(\Symfony\Component\HttpFoundation\Request::class); + $request->getLocale()->willReturn('fr'); + + $this->filter = self::$container->get('chill.person.export.filter_step'); + } + + /** + * @inheritDoc + */ + public function getFilter() + { + return $this->filter; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + return [ + ['accepted_steps' => AccompanyingPeriod::STEP_DRAFT], + ['accepted_steps' => AccompanyingPeriod::STEP_CONFIRMED], + ['accepted_steps' => AccompanyingPeriod::STEP_CLOSED], + ]; + } + + /** + * @inheritDoc + */ + public function getQueryBuilders(): array + { + + if (null === self::$kernel) { + self::bootKernel(); + } + + $em = self::$container->get('doctrine.orm.entity_manager'); + + return [ + $em->createQueryBuilder() + ->select('acp.id') + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp'), + ]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/UserJobFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/UserJobFilterTest.php new file mode 100644 index 000000000..452728384 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/UserJobFilterTest.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_userjob'); + } + + /** + * @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('acp.id') + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp'), + ]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/UserScopeFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/UserScopeFilterTest.php new file mode 100644 index 000000000..fd22ded6e --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/UserScopeFilterTest.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_userscope'); + + } + + /** + * @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('acp.id') + ->from('ChillPersonBundle:AccompanyingPeriod', 'acp'), + ]; + } +} \ No newline at end of file From b9186ed6e01cf8af6a29e8a49ad553c769f35f8c Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 27 Jul 2022 18:39:58 +0200 Subject: [PATCH 5/5] tests: write a simple Export test for new indicators + fix depreciation with BrowserKit client cfr: https://symfony.com/doc/4.4/components/browser_kit.html#creating-a-client --- .../Test/Export/AbstractExportTest.php | 6 ++- .../Export/CountAccompanyingCourseTest.php | 43 +++++++++++++++++++ .../StatAccompanyingCourseDurationTest.php | 36 ++++++++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseTest.php create mode 100644 src/Bundle/ChillPersonBundle/Tests/Export/Export/StatAccompanyingCourseDurationTest.php diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php index a80753a46..60d539573 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractExportTest.php @@ -16,6 +16,7 @@ use Doctrine\ORM\NativeQuery; use Doctrine\ORM\QueryBuilder; use RuntimeException; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; +use Symfony\Component\BrowserKit\HttpBrowser; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\Role\Role; use Traversable; @@ -332,8 +333,9 @@ abstract class AbstractExportTest extends WebTestCase */ public function testListExportPage() { - /** @var \Symfony\Component\BrowserKit\Client $client */ - $client = $this->getClient(); + /** @var HttpBrowser $client */ + $client = new HttpBrowser(); + $export = $this->getExport(); $prophet = new \Prophecy\Prophet(); $container = static::$kernel->getContainer(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseTest.php new file mode 100644 index 000000000..d6fa9a843 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseTest.php @@ -0,0 +1,43 @@ +export = self::$container->get('chill.person.export.count_accompanyingcourse'); + } + + /** + * @inheritDoc + */ + public function getExport() + { + return $this->export; + } + + /** + * @inheritDoc + */ + public function getFormData(): array + { + return [[]]; + } + + /** + * @inheritDoc + */ + public function getModifiersCombination() + { + return [[Declarations::ACP_TYPE]]; + } +} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/StatAccompanyingCourseDurationTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/StatAccompanyingCourseDurationTest.php new file mode 100644 index 000000000..7c1420c86 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/StatAccompanyingCourseDurationTest.php @@ -0,0 +1,36 @@ +export = self::$container->get('chill.person.export.avg_accompanyingcourse_duration'); + } + + public function getExport() + { + return $this->export; + } + + public function getFormData(): array + { + return [ + ['closingdate' => \DateTime::createFromFormat('Y-m-d', '2022-06-30')], + ]; + } + + public function getModifiersCombination() + { + return [[Declarations::ACP_TYPE]]; + } +} \ No newline at end of file