Add environment variables for data creation for testing

This commit is contained in:
2024-12-25 02:48:32 +00:00
parent 12199b6152
commit 2655848d96
7 changed files with 27 additions and 12 deletions

View File

@ -20,10 +20,12 @@ class UserFixture extends Fixture
public function load(ObjectManager $manager): void
{
return;
if(!$_ENV['CREATE_USERS']) {
return;
}
$comp = $manager->getRepository(Company::class)->findOneBy(['name' => 'Counseling Partners, LLC']);
$gen = \Faker\Factory::create();
for ($x = 0; $x < 20; $x++) {
for ($x = 0; $x < $_ENV['CREATE_USERS']; $x++) {
$user = new User();
$name = $gen->firstName().' '.$gen->lastName();
$username = strtolower(str_replace(' ', '.', $name));