10 use Magento\Customer\Model\AddressFactory;
12 use Magento\Customer\Model\CustomerFactory;
23 private $customerFactory;
28 private $addressFactory;
33 private $storeManager;
41 CustomerFactory $customerFactory,
42 AddressFactory $addressFactory,
68 private function getCustomerTemplate()
70 $customerRandomizerNumber = crc32(mt_rand(1, PHP_INT_MAX));
72 $now = new \DateTime();
74 return $this->customerFactory->create([
77 'confirmation' =>
null,
78 'created_at' => $now->format(\
Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT),
79 'created_in' =>
'Default',
80 'default_billing' =>
'1',
81 'default_shipping' =>
'1',
82 'disable_auto_group_change' =>
'0',
83 'dob' =>
'12-10-1991',
84 'firstname' =>
'Firstname',
87 'lastname' =>
'Lastname',
89 'password_hash' =>
'',
92 'rp_token_created_at' =>
null,
93 'store_id' => $this->storeManager->getDefaultStoreView()->getId(),
96 'website_id' => $this->storeManager->getDefaultStoreView()->getWebsiteId(),
97 'password' =>
'123123q',
108 return $this->addressFactory->create([
111 'attribute_set_id' => 2,
112 'telephone' => 3468676,
114 'country_id' =>
'US',
116 'company' =>
'CompanyName',
117 'street' =>
'Green str, 67',
118 'lastname' =>
'Smith',
119 'firstname' =>
'John',
124 'region' =>
'Arkansas',
127 'default_billing_' =>
'1',
128 'default_shipping_' =>
'1',
__construct(CustomerFactory $customerFactory, AddressFactory $addressFactory, StoreManagerInterface $storeManager)