5
5
*/
6
6
namespace Magento \Quote \Api ;
7
7
8
+ use Magento \Framework \Api \ExtensibleDataInterface ;
8
9
use Magento \TestFramework \ObjectManager ;
9
10
use Magento \TestFramework \TestCase \WebapiAbstract ;
10
11
use Magento \Quote \Api \Data \AddressInterface ;
@@ -26,6 +27,8 @@ protected function setUp()
26
27
}
27
28
28
29
/**
30
+ * @magentoAppIsolation enabled
31
+ * @magentoDbIsolation disabled
29
32
* @magentoApiDataFixture Magento/SalesRule/_files/cart_rule_free_shipping.php
30
33
* @magentoApiDataFixture Magento/Sales/_files/quote.php
31
34
*/
@@ -59,7 +62,7 @@ public function testEstimateByExtendedAddress()
59
62
];
60
63
if (TESTS_WEB_API_ADAPTER == self ::ADAPTER_SOAP ) {
61
64
/** @var \Magento\Quote\Model\Quote\Address $address */
62
- $ address = $ quote ->getBillingAddress ();
65
+ $ address = $ quote ->getShippingAddress ();
63
66
64
67
$ data = [
65
68
AddressInterface::KEY_ID => (int )$ address ->getId (),
@@ -79,9 +82,8 @@ public function testEstimateByExtendedAddress()
79
82
AddressInterface::SAME_AS_BILLING => $ address ->getSameAsBilling (),
80
83
AddressInterface::CUSTOMER_ADDRESS_ID => $ address ->getCustomerAddressId (),
81
84
AddressInterface::SAVE_IN_ADDRESS_BOOK => $ address ->getSaveInAddressBook (),
82
-
83
- 'extension_attributes ' => [
84
- 'test_attribute ' => 1
85
+ ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY => [
86
+ 'discounts ' => []
85
87
]
86
88
];
87
89
@@ -90,19 +92,24 @@ public function testEstimateByExtendedAddress()
90
92
'address ' => $ data
91
93
];
92
94
} else {
95
+
93
96
$ requestData = [
94
97
'address ' => [
95
98
'country_id ' => "US " ,
96
99
'postcode ' => null ,
97
100
'region ' => null ,
98
- 'region_id ' => null
99
- ],
101
+ 'region_id ' => null ,
102
+ 'extension_attributes ' => [
103
+ 'discounts ' => []
104
+ ]
105
+ ]
100
106
];
101
107
}
102
108
// Cart must be anonymous (see fixture)
103
109
$ this ->assertEmpty ($ quote ->getCustomerId ());
104
110
105
111
$ result = $ this ->_webApiCall ($ serviceInfo , $ requestData );
112
+
106
113
$ this ->assertNotEmpty ($ result );
107
114
$ this ->assertEquals (1 , count ($ result ));
108
115
foreach ($ result as $ rate ) {
0 commit comments