This repository has been archived by the owner on Dec 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Merge Pull Request #496 from magento/graphql-ce:485-testReSetShippingMethod - Merged commits: 1. 4f19d03 2. 43f5bce 3. 4bdc30e 4. f9ecace 5. 5d9a64e 6. f01dc00 7. 16ce046 8. c2f15b3 9. 14d5c3d 10. 2643424 11. cf4eb72 12. 829a39b 13. 4837778 14. 1c582f1
- Loading branch information
Showing
16 changed files
with
577 additions
and
118 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
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
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
53 changes: 53 additions & 0 deletions
53
...functional/testsuite/Magento/GraphQl/Quote/GetQuoteShippingAddressIdByReservedQuoteId.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,53 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\GraphQl\Quote; | ||
|
||
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; | ||
use Magento\Quote\Model\QuoteFactory; | ||
|
||
/** | ||
* Get quote shipping address id by reserved order id | ||
*/ | ||
class GetQuoteShippingAddressIdByReservedQuoteId | ||
{ | ||
/** | ||
* @var QuoteFactory | ||
*/ | ||
private $quoteFactory; | ||
|
||
/** | ||
* @var QuoteResource | ||
*/ | ||
private $quoteResource; | ||
|
||
/** | ||
* @param QuoteFactory $quoteFactory | ||
* @param QuoteResource $quoteResource | ||
*/ | ||
public function __construct( | ||
QuoteFactory $quoteFactory, | ||
QuoteResource $quoteResource | ||
) { | ||
$this->quoteFactory = $quoteFactory; | ||
$this->quoteResource = $quoteResource; | ||
} | ||
|
||
/** | ||
* Get quote shipping address id by reserved order id | ||
* | ||
* @param string $reversedOrderId | ||
* @return int | ||
*/ | ||
public function execute(string $reversedOrderId): int | ||
{ | ||
$quote = $this->quoteFactory->create(); | ||
$this->quoteResource->load($quote, $reversedOrderId, 'reserved_order_id'); | ||
|
||
return (int)$quote->getShippingAddress()->getId(); | ||
} | ||
} |
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
Oops, something went wrong.