8
8
namespace Magento \GraphQl \Ups ;
9
9
10
10
use Magento \GraphQl \Quote \GetMaskedQuoteIdByReservedOrderId ;
11
+ use Magento \GraphQl \Quote \GetQuoteShippingAddressIdByReservedQuoteId ;
11
12
use Magento \Integration \Api \CustomerTokenServiceInterface ;
12
- use Magento \Quote \Model \Quote ;
13
13
use Magento \Quote \Model \ResourceModel \Quote as QuoteResource ;
14
14
use Magento \TestFramework \Helper \Bootstrap ;
15
15
use Magento \TestFramework \TestCase \GraphQlAbstract ;
@@ -30,9 +30,9 @@ class SetUpsShippingMethodsOnCartTest extends GraphQlAbstract
30
30
const CARRIER_METHOD_CODE_GROUND = 'GND ' ;
31
31
32
32
/**
33
- * @var Quote
33
+ * @var GetQuoteShippingAddressIdByReservedQuoteId
34
34
*/
35
- private $ quote ;
35
+ private $ getQuoteShippingAddressIdByReservedQuoteId ;
36
36
37
37
/**
38
38
* @var CustomerTokenServiceInterface
@@ -50,9 +50,9 @@ class SetUpsShippingMethodsOnCartTest extends GraphQlAbstract
50
50
protected function setUp ()
51
51
{
52
52
$ objectManager = Bootstrap::getObjectManager ();
53
- $ this ->quote = $ objectManager ->create (Quote::class);
54
53
$ this ->customerTokenService = $ objectManager ->get (CustomerTokenServiceInterface::class);
55
54
$ this ->getMaskedQuoteIdByReservedOrderId = $ objectManager ->get (GetMaskedQuoteIdByReservedOrderId::class);
55
+ $ this ->getQuoteShippingAddressIdByReservedQuoteId = $ objectManager ->get (GetQuoteShippingAddressIdByReservedQuoteId::class);
56
56
}
57
57
58
58
/**
@@ -67,10 +67,9 @@ public function testSetUpsShippingMethod()
67
67
{
68
68
$ quoteReservedId = 'test_quote ' ;
69
69
$ 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 );
72
71
73
- $ query = $ this ->getAddUpsShippingMethodQuery (
72
+ $ query = $ this ->getQuery (
74
73
$ maskedQuoteId ,
75
74
$ shippingAddressId ,
76
75
self ::CARRIER_CODE ,
@@ -96,7 +95,7 @@ public function testSetUpsShippingMethod()
96
95
* @param string $methodCode
97
96
* @return string
98
97
*/
99
- private function getAddUpsShippingMethodQuery (
98
+ private function getQuery (
100
99
string $ maskedQuoteId ,
101
100
int $ shippingAddressId ,
102
101
string $ carrierCode ,
0 commit comments