-
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.
Merge branch '2.3-develop-graphql-PR-yogesh-5' into 542-new-fixture-f…
…or-SetOfflineShippingMethodsOnCartTest
- 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.