mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
Refactor ListPersonHelper and ListPerson to simplify process and allow to add customization of fields
This commit is contained in:
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Tests\Export\Export;
|
||||
|
||||
use Chill\MainBundle\Export\Helper\ExportAddressHelper;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
@@ -35,13 +34,11 @@ class ListPersonHavingAccompanyingPeriodTest extends AbstractExportTest
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
$addressHelper = self::$container->get(ExportAddressHelper::class);
|
||||
$listPersonHelper = self::$container->get(ListPersonHelper::class);
|
||||
$entityManager = self::$container->get(EntityManagerInterface::class);
|
||||
$rollingDateconverter = self::$container->get(RollingDateConverterInterface::class);
|
||||
|
||||
yield new ListPersonHavingAccompanyingPeriod(
|
||||
$addressHelper,
|
||||
$listPersonHelper,
|
||||
$entityManager,
|
||||
$rollingDateconverter,
|
||||
@@ -49,7 +46,6 @@ class ListPersonHavingAccompanyingPeriodTest extends AbstractExportTest
|
||||
);
|
||||
|
||||
yield new ListPersonHavingAccompanyingPeriod(
|
||||
$addressHelper,
|
||||
$listPersonHelper,
|
||||
$entityManager,
|
||||
$rollingDateconverter,
|
||||
@@ -59,7 +55,7 @@ class ListPersonHavingAccompanyingPeriodTest extends AbstractExportTest
|
||||
|
||||
public function getFormData()
|
||||
{
|
||||
return [['address_date_rolling' => new RollingDate(RollingDate::T_TODAY), 'fields' => ListPersonHelper::FIELDS]];
|
||||
return [['address_date_rolling' => new RollingDate(RollingDate::T_TODAY)]];
|
||||
}
|
||||
|
||||
public function getModifiersCombination()
|
||||
|
@@ -12,7 +12,6 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Tests\Export\Export;
|
||||
|
||||
use Chill\CustomFieldsBundle\Service\CustomFieldProvider;
|
||||
use Chill\MainBundle\Export\Helper\ExportAddressHelper;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
||||
use Chill\PersonBundle\Export\Export\ListPerson;
|
||||
@@ -50,14 +49,12 @@ final class ListPersonTest extends AbstractExportTest
|
||||
|
||||
public function getExport()
|
||||
{
|
||||
$addressHelper = self::$container->get(ExportAddressHelper::class);
|
||||
$customFieldProvider = self::$container->get(CustomFieldProvider::class);
|
||||
$listPersonHelper = self::$container->get(ListPersonHelper::class);
|
||||
$entityManager = self::$container->get(EntityManagerInterface::class);
|
||||
$translatableStringHelper = self::$container->get(TranslatableStringHelper::class);
|
||||
|
||||
yield new ListPerson(
|
||||
$addressHelper,
|
||||
$customFieldProvider,
|
||||
$listPersonHelper,
|
||||
$entityManager,
|
||||
@@ -66,7 +63,6 @@ final class ListPersonTest extends AbstractExportTest
|
||||
);
|
||||
|
||||
yield new ListPerson(
|
||||
$addressHelper,
|
||||
$customFieldProvider,
|
||||
$listPersonHelper,
|
||||
$entityManager,
|
||||
@@ -77,15 +73,7 @@ final class ListPersonTest extends AbstractExportTest
|
||||
|
||||
public function getFormData(): iterable
|
||||
{
|
||||
foreach ([
|
||||
['fields' => ['id', 'firstName', 'lastName']],
|
||||
['fields' => ['id', 'birthdate', 'gender', 'memo', 'email', 'phonenumber']],
|
||||
['fields' => ['firstName', 'lastName', 'phonenumber']],
|
||||
['fields' => ['id', 'nationality']],
|
||||
['fields' => ['id', 'countryOfBirth']],
|
||||
] as $base) {
|
||||
yield [...$base, 'address_date' => new \DateTimeImmutable('today')];
|
||||
}
|
||||
yield ['address_date' => new \DateTimeImmutable('today')];
|
||||
}
|
||||
|
||||
public function getModifiersCombination(): array
|
||||
|
Reference in New Issue
Block a user