Skip to content

Commit

Permalink
fix potential generation of same email address for customers
Browse files Browse the repository at this point in the history
  • Loading branch information
agranjeon committed May 28, 2019
1 parent 53f2b5f commit 04f0c2a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Model/Faker/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@ public function generateFakeData(OutputInterface $output): void

/** @var Store $store */
foreach ($this->getStores() as $store) {
$faker = $this->getFaker($store);
$websiteId = $store->getWebsiteId();
$storeId = $store->getStoreId();
$faker = $this->getFaker($store);
$websiteId = $store->getWebsiteId();
$storeId = $store->getStoreId();
$customerNumber = (int)$this->getStoreConfig('faker/customer/number', $storeId);

$progressBar = new ProgressBar(
$output->section(),
$customerNumber
$output->section(), $customerNumber
);
$progressBar->setFormat(
'<info>%message%</info> %current%/%max% [%bar%] %percent:3s%% %elapsed% %memory:6s%'
Expand All @@ -94,7 +93,7 @@ public function generateFakeData(OutputInterface $output): void
CustomerInterface::PREFIX => $faker->title,
CustomerInterface::FIRSTNAME => $faker->firstName,
CustomerInterface::LASTNAME => $faker->lastName,
CustomerInterface::EMAIL => $faker->email,
CustomerInterface::EMAIL => uniqid().$faker->email,
CustomerInterface::DOB => $faker->date('m/d/Y'),
CustomerInterface::GENDER => $faker->numberBetween(0, 1),
CustomerInterface::GROUP_ID => $customerGroupIds[array_rand($customerGroupIds)],
Expand Down

0 comments on commit 04f0c2a

Please sign in to comment.