billing_address.php 970 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. use Magento\Quote\Api\Data\AddressInterface;
  8. use Magento\TestFramework\Helper\Bootstrap;
  9. use Magento\TestFramework\ObjectManager;
  10. /**
  11. * @var Magento\Quote\Model\Quote $quote
  12. */
  13. if (empty($quote)) {
  14. throw new \Exception('$quote should be defined in the parent fixture');
  15. }
  16. $data = [
  17. 'firstname' => 'Jonh',
  18. 'lastname' => 'Doe',
  19. 'telephone' => '0333-233-221',
  20. 'street' => ['Third Division 1'],
  21. 'city' => 'New York',
  22. 'region' => 'NY',
  23. 'postcode' => 10029,
  24. 'country_id' => 'US',
  25. 'email' => 'customer001@billing.test',
  26. 'address_type' => 'billing',
  27. ];
  28. /** @var ObjectManager $objectManager */
  29. $objectManager = Bootstrap::getObjectManager();
  30. /** @var AddressInterface $address */
  31. $address = $objectManager->create(AddressInterface::class, ['data' => $data]);
  32. $quote->setBillingAddress($address);