mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
Merge remote-tracking branch 'origin/master' into upgrade-sf5
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::getContainer()->get(ExportAddressHelper::class);
|
||||
$listPersonHelper = self::getContainer()->get(ListPersonHelper::class);
|
||||
$entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$rollingDateconverter = self::getContainer()->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 static function getFormData(): array
|
||||
{
|
||||
return [['address_date_rolling' => new RollingDate(RollingDate::T_TODAY), 'fields' => ListPersonHelper::FIELDS]];
|
||||
return [['address_date_rolling' => new RollingDate(RollingDate::T_TODAY)]];
|
||||
}
|
||||
|
||||
public static function getModifiersCombination(): array
|
||||
|
@@ -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::getContainer()->get(ExportAddressHelper::class);
|
||||
$customFieldProvider = self::getContainer()->get(CustomFieldProvider::class);
|
||||
$listPersonHelper = self::getContainer()->get(ListPersonHelper::class);
|
||||
$entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$translatableStringHelper = self::getContainer()->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,18 +73,7 @@ final class ListPersonTest extends AbstractExportTest
|
||||
|
||||
public static function getFormData(): array
|
||||
{
|
||||
$data = [];
|
||||
foreach ([
|
||||
['fields' => ['id', 'firstName', 'lastName']],
|
||||
['fields' => ['id', 'birthdate', 'gender', 'memo', 'email', 'phonenumber']],
|
||||
['fields' => ['firstName', 'lastName', 'phonenumber']],
|
||||
['fields' => ['id', 'nationality']],
|
||||
['fields' => ['id', 'countryOfBirth']],
|
||||
] as $base) {
|
||||
$data[] = [...$base, 'address_date' => new \DateTimeImmutable('today')];
|
||||
}
|
||||
|
||||
return $data;
|
||||
yield ['address_date' => new \DateTimeImmutable('today')];
|
||||
}
|
||||
|
||||
public static function getModifiersCombination(): array
|
||||
|
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Export\Filter\SocialWorkFilters;
|
||||
|
||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||
use Chill\MainBundle\Test\Export\AbstractFilterTest;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Chill\PersonBundle\Export\Filter\SocialWorkFilters\AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
final class WithEvaluationBetweenDatesFilterTest extends AbstractFilterTest
|
||||
{
|
||||
private AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter $filter;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$this->filter = self::$container->get(AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter::class);
|
||||
}
|
||||
|
||||
public function getFilter()
|
||||
{
|
||||
return $this->filter;
|
||||
}
|
||||
|
||||
public function getFormData()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'start_date' => new RollingDate(RollingDate::T_MONTH_CURRENT_START),
|
||||
'end_date' => new RollingDate(RollingDate::T_TODAY),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getQueryBuilders()
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
|
||||
return [
|
||||
$em->createQueryBuilder()
|
||||
->select('acpw.id')
|
||||
->from(AccompanyingPeriodWork::class, 'acpw'),
|
||||
];
|
||||
}
|
||||
}
|
@@ -529,7 +529,7 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase
|
||||
/**
|
||||
* @param array<Scope> $scopes
|
||||
*/
|
||||
private static function buildPeriod(Person $person, array $scopes, User|null $creator, bool $confirm): AccompanyingPeriod
|
||||
private static function buildPeriod(Person $person, array $scopes, ?User $creator, bool $confirm): AccompanyingPeriod
|
||||
{
|
||||
$entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
||||
$registry = self::getContainer()->get(Registry::class);
|
||||
|
Reference in New Issue
Block a user