Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
billing_address.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
11 
16 if (empty($quote)) {
17  throw new \Exception('$quote should be defined in the parent fixture');
18 }
19 
20 $data = [
21  'firstname' => 'Jonh',
22  'lastname' => 'Doe',
23  'telephone' => '0333-233-221',
24  'street' => ['Third Division 1'],
25  'city' => 'New York',
26  'region' => 'NY',
27  'postcode' => 10029,
28  'country_id' => 'US',
29  'email' => '[email protected]',
30  'address_type' => 'billing',
31 ];
32 
34 $objectManager = Bootstrap::getObjectManager();
35 
37 $address = $objectManager->create(AddressInterface::class, ['data' => $data]);
38 $quote->setBillingAddress($address);
$quote
if(empty($quote)) $data
$address
$objectManager