mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-19 04:08:06 +00:00
Add seeds to data fixtures, to avoid random failures in tests
This commit is contained in:
@@ -30,6 +30,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
mt_srand(123456789);
|
||||
$this->phoneNumberUtil = PhoneNumberUtil::getInstance();
|
||||
}
|
||||
|
||||
@@ -68,7 +69,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
|
||||
static fn ($a) => $a['ref'],
|
||||
LoadCenters::$centers
|
||||
);
|
||||
$number = random_int(1, \count($references));
|
||||
$number = mt_rand(1, \count($references));
|
||||
|
||||
if (1 === $number) {
|
||||
yield $this->getReference($references[array_rand($references)], Center::class);
|
||||
|
||||
Reference in New Issue
Block a user