Fix phpunit pipeline

This commit is contained in:
2024-10-29 15:30:20 +01:00
parent d04f9ae9ff
commit ac3ac432e1
5 changed files with 46 additions and 8 deletions

View File

@@ -80,14 +80,15 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord
*/
protected array $cacheUsers = [];
/**
* @var array|Gender[]
*/
protected array $cacheGenders = [];
protected Generator $faker;
protected NativeLoader $loader;
// private array $genders = [GenderEnum::MALE, GenderEnum::FEMALE, GenderEnum::NEUTRAL];
private array $peoples = [
[
'lastName' => 'Depardieu',
@@ -124,7 +125,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord
'maritalStatus' => 'ms_divorce',
],
[
// to have a person with same birthdate of Gérard Depardieu
// to have a person with same birthdate as Gérard Depardieu
'lastName' => 'Van Snick',
'firstName' => 'Bart',
'birthdate' => '1948-12-27',
@@ -281,7 +282,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord
public function getRandomGender(int $nullPercentage = 50): ?Gender
{
if (0 === \count($this->cacheGenders)) {
$this->cacheGenders = $this->genderRepository->findAll();
$this->cacheGenders = $this->genderRepository->findByActiveOrdered();
}
if (\random_int(0, 100) > $nullPercentage) {