Fix tests

This commit is contained in:
2023-09-01 16:10:04 +02:00
parent 10a75f44e9
commit 2c52a5bffa
9 changed files with 22 additions and 21 deletions

View File

@@ -27,7 +27,7 @@ final class CountAccompanyingPeriodWorkTest extends AbstractExportTest
{
self::bootKernel();
$this->export = self::$container->get('chill.person.export.count_social_work_actions');
$this->export = self::$container->get(CountAccompanyingPeriodWork::class);
}
public function getExport()

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest;
use Chill\PersonBundle\Export\Export\CountPerson;
/**
* Test CountPerson export.
@@ -30,7 +31,7 @@ final class CountPersonTest extends AbstractExportTest
{
self::bootKernel();
$this->export = self::$container->get('chill.person.export.count_person');
$this->export = self::$container->get(CountPerson::class);
}
public function getExport()

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Export\Export;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Test\Export\AbstractExportTest;
use Chill\PersonBundle\Export\Export\ListPerson;
use DateTime;
@@ -32,7 +33,7 @@ final class ListPersonTest extends AbstractExportTest
{
self::bootKernel();
$this->export = self::$container->get('chill.person.export.list_person');
$this->export = self::$container->get(ListPerson::class);
$request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
@@ -48,20 +49,17 @@ final class ListPersonTest extends AbstractExportTest
return $this->export;
}
public function getFormData(): array
public function getFormData(): iterable
{
return [
foreach ([
['fields' => ['id', 'firstName', 'lastName']],
['fields' => ['id', 'birthdate', 'gender', 'memo', 'email', 'phonenumber']],
['fields' => ['firstName', 'lastName', 'phonenumber']],
['fields' => ['id', 'nationality']],
['fields' => ['id', 'countryOfBirth']],
['fields' => ['id', 'address_street_address_1',
'address_street_address_2', 'address_valid_from',
'address_postcode_label', 'address_postcode_code',
'address_country_name', 'address_country_code', ],
'address_date' => DateTime::createFromFormat('Y-m-d', '2016-06-12'), ],
];
] as $base) {
yield [...$base, 'address_date' => new \DateTimeImmutable('today') ];
}
}
public function getModifiersCombination(): array