mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
cs: Enable risky rule random_api_migration
.
This commit is contained in:
@@ -65,15 +65,15 @@ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface
|
||||
];
|
||||
|
||||
for ($i = 0; 25 >= $i; ++$i) {
|
||||
$cFType = $cFTypes[rand(0, count($cFTypes) - 1)];
|
||||
$cFType = $cFTypes[mt_rand(0, count($cFTypes) - 1)];
|
||||
|
||||
$customField = (new CustomField())
|
||||
->setSlug("cf_report_{$i}")
|
||||
->setType($cFType['type'])
|
||||
->setOptions($cFType['options'])
|
||||
->setName(['fr' => "CustomField {$i}"])
|
||||
->setOrdering(rand(0, 1000) / 1000)
|
||||
->setCustomFieldsGroup($this->getReference('cf_group_report_' . (rand(0, 3))));
|
||||
->setOrdering(mt_rand(0, 1000) / 1000)
|
||||
->setCustomFieldsGroup($this->getReference('cf_group_report_' . (mt_rand(0, 3))));
|
||||
|
||||
$manager->persist($customField);
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ class LoadReports extends AbstractFixture implements OrderedFixtureInterface, Co
|
||||
$report = (new Report())
|
||||
->setPerson($person)
|
||||
->setCFGroup(
|
||||
rand(0, 10) > 5 ?
|
||||
mt_rand(0, 10) > 5 ?
|
||||
$this->getReference('cf_group_report_logement') :
|
||||
$this->getReference('cf_group_report_education')
|
||||
)
|
||||
@@ -107,7 +107,7 @@ class LoadReports extends AbstractFixture implements OrderedFixtureInterface, Co
|
||||
//set date. 30% of the dates are 2015-05-01
|
||||
$expectedDate = new DateTime('2015-01-05');
|
||||
|
||||
if (rand(0, 100) < 30) {
|
||||
if (mt_rand(0, 100) < 30) {
|
||||
$report->setDate($expectedDate);
|
||||
} else {
|
||||
$report->setDate($this->faker->dateTimeBetween('-1 year', 'now')
|
||||
@@ -151,7 +151,7 @@ class LoadReports extends AbstractFixture implements OrderedFixtureInterface, Co
|
||||
$selectedPeople = [];
|
||||
|
||||
foreach ($people as $person) {
|
||||
if (rand(0, 100) < $percentage) {
|
||||
if (mt_rand(0, 100) < $percentage) {
|
||||
$selectedPeople[] = $person;
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ class LoadReports extends AbstractFixture implements OrderedFixtureInterface, Co
|
||||
$picked = [];
|
||||
|
||||
if ($multiple) {
|
||||
$numberSelected = rand(1, count($choices) - 1);
|
||||
$numberSelected = mt_rand(1, count($choices) - 1);
|
||||
|
||||
for ($i = 0; $i < $numberSelected; ++$i) {
|
||||
$picked[] = $this->pickChoice($choices);
|
||||
|
@@ -187,6 +187,6 @@ class TimelineProviderTest extends WebTestCase
|
||||
}
|
||||
}
|
||||
|
||||
return $groups[rand(0, count($groups) - 1)];
|
||||
return $groups[mt_rand(0, count($groups) - 1)];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user