Skip to content

Commit ba6c523

Browse files
committed
magento/graphql-ce#540: Replace deprecated Magento/Checkout/_files/quote_with_address_saved.php fixture in SetUpsShippingMethodsOnCartTest
1 parent 5dd5e3a commit ba6c523

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Ups/SetUpsShippingMethodsOnCartTest.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
namespace Magento\GraphQl\Ups;
99

1010
use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
11+
use Magento\GraphQl\Quote\GetQuoteShippingAddressIdByReservedQuoteId;
1112
use Magento\Integration\Api\CustomerTokenServiceInterface;
12-
use Magento\Quote\Model\Quote;
1313
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
1414
use Magento\TestFramework\Helper\Bootstrap;
1515
use Magento\TestFramework\TestCase\GraphQlAbstract;
@@ -30,9 +30,9 @@ class SetUpsShippingMethodsOnCartTest extends GraphQlAbstract
3030
const CARRIER_METHOD_CODE_GROUND = 'GND';
3131

3232
/**
33-
* @var Quote
33+
* @var GetQuoteShippingAddressIdByReservedQuoteId
3434
*/
35-
private $quote;
35+
private $getQuoteShippingAddressIdByReservedQuoteId;
3636

3737
/**
3838
* @var CustomerTokenServiceInterface
@@ -50,9 +50,9 @@ class SetUpsShippingMethodsOnCartTest extends GraphQlAbstract
5050
protected function setUp()
5151
{
5252
$objectManager = Bootstrap::getObjectManager();
53-
$this->quote = $objectManager->create(Quote::class);
5453
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
5554
$this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
55+
$this->getQuoteShippingAddressIdByReservedQuoteId = $objectManager->get(GetQuoteShippingAddressIdByReservedQuoteId::class);
5656
}
5757

5858
/**
@@ -67,10 +67,9 @@ public function testSetUpsShippingMethod()
6767
{
6868
$quoteReservedId = 'test_quote';
6969
$maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($quoteReservedId);
70-
$quote = $this->quote->load($quoteReservedId, 'reserved_order_id');
71-
$shippingAddressId = (int)$quote->getShippingAddress()->getId();
70+
$shippingAddressId = $this->getQuoteShippingAddressIdByReservedQuoteId->execute($quoteReservedId);
7271

73-
$query = $this->getAddUpsShippingMethodQuery(
72+
$query = $this->getQuery(
7473
$maskedQuoteId,
7574
$shippingAddressId,
7675
self::CARRIER_CODE,
@@ -96,7 +95,7 @@ public function testSetUpsShippingMethod()
9695
* @param string $methodCode
9796
* @return string
9897
*/
99-
private function getAddUpsShippingMethodQuery(
98+
private function getQuery(
10099
string $maskedQuoteId,
101100
int $shippingAddressId,
102101
string $carrierCode,

0 commit comments

Comments
 (0)