From 2ccdc8e3b063c1687dde2e004ce7218077e8f1e7 Mon Sep 17 00:00:00 2001 From: Jonas Elfering Date: Mon, 8 Apr 2019 15:11:03 +0200 Subject: [PATCH] NTR - Fix customer generator --- Framework/Demodata/Generator/CustomerGenerator.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Framework/Demodata/Generator/CustomerGenerator.php b/Framework/Demodata/Generator/CustomerGenerator.php index 0ce36562eb..fa90e7b803 100644 --- a/Framework/Demodata/Generator/CustomerGenerator.php +++ b/Framework/Demodata/Generator/CustomerGenerator.php @@ -97,6 +97,9 @@ private function createDefaultCustomer(Context $context): void $shippingAddressId = Uuid::randomHex(); $billingAddressId = Uuid::randomHex(); $salutationId = Uuid::fromBytesToHex($this->getRandomSalutationId()); + $countries = $this->connection + ->executeQuery('SELECT id FROM country WHERE active = 1') + ->fetchAll(FetchMode::COLUMN); $customer = [ 'id' => $id, @@ -115,7 +118,7 @@ private function createDefaultCustomer(Context $context): void [ 'id' => $shippingAddressId, 'customerId' => $id, - 'countryId' => 'ffe61e1c99154f9597014a310ab5482d', + 'countryId' => Uuid::fromBytesToHex($countries[array_rand($countries)]), 'salutationId' => $salutationId, 'firstName' => 'Max', 'lastName' => 'Mustermann', @@ -126,7 +129,7 @@ private function createDefaultCustomer(Context $context): void [ 'id' => $billingAddressId, 'customerId' => $id, - 'countryId' => 'ffe61e1c99154f9597014a310ab5482d', + 'countryId' => Uuid::fromBytesToHex($countries[array_rand($countries)]), 'salutationId' => $salutationId, 'firstName' => 'Max', 'lastName' => 'Mustermann',