-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENGCOM-4764: magento/graphql-ce#540: Replace deprecated fixture #541
- Merge Pull Request magento/graphql-ce#541 from magento/graphql-ce:540-new-fixture-for-SetUpsShippingMethodsOnCartTest - Merged commits: 1. 37b4855 2. 8d107c5 3. 5dd5e3a 4. ba6c523 5. 844fc58 6. 3d891d3 7. 38b106f 8. b946dd0 9. 17ca1ef 10. 78f02fa 11. b027198 12. 8f0c233 13. 9d475b8 14. c9cf1a9 15. 259ee45
- Loading branch information
Showing
5 changed files
with
194 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...ts/integration/testsuite/Magento/GraphQl/Quote/_files/set_new_shipping_canada_address.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
use Magento\Framework\Api\DataObjectHelper; | ||
use Magento\Quote\Api\Data\AddressInterface; | ||
use Magento\Quote\Api\Data\AddressInterfaceFactory; | ||
use Magento\Quote\Model\QuoteFactory; | ||
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; | ||
use Magento\Quote\Model\ShippingAddressManagementInterface; | ||
use Magento\TestFramework\Helper\Bootstrap; | ||
|
||
/** @var QuoteFactory $quoteFactory */ | ||
$quoteFactory = Bootstrap::getObjectManager()->get(QuoteFactory::class); | ||
/** @var QuoteResource $quoteResource */ | ||
$quoteResource = Bootstrap::getObjectManager()->get(QuoteResource::class); | ||
/** @var AddressInterfaceFactory $quoteAddressFactory */ | ||
$quoteAddressFactory = Bootstrap::getObjectManager()->get(AddressInterfaceFactory::class); | ||
/** @var DataObjectHelper $dataObjectHelper */ | ||
$dataObjectHelper = Bootstrap::getObjectManager()->get(DataObjectHelper::class); | ||
/** @var ShippingAddressManagementInterface $shippingAddressManagement */ | ||
$shippingAddressManagement = Bootstrap::getObjectManager()->get(ShippingAddressManagementInterface::class); | ||
|
||
$quoteAddressData = [ | ||
AddressInterface::KEY_TELEPHONE => 3468676, | ||
AddressInterface::KEY_POSTCODE => 'M4L 1V3', | ||
AddressInterface::KEY_COUNTRY_ID => 'CA', | ||
AddressInterface::KEY_CITY => 'Toronto', | ||
AddressInterface::KEY_COMPANY => 'CompanyName', | ||
AddressInterface::KEY_STREET => '500 Kingston Rd', | ||
AddressInterface::KEY_LASTNAME => 'Smith', | ||
AddressInterface::KEY_FIRSTNAME => 'John', | ||
AddressInterface::KEY_REGION_CODE => 'ON', | ||
]; | ||
$quoteAddress = $quoteAddressFactory->create(); | ||
$dataObjectHelper->populateWithArray($quoteAddress, $quoteAddressData, AddressInterfaceFactory::class); | ||
|
||
$quote = $quoteFactory->create(); | ||
$quoteResource->load($quote, 'test_quote', 'reserved_order_id'); | ||
$shippingAddressManagement->assign($quote->getId(), $quoteAddress); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters