@@ -83,12 +83,35 @@ function (string $message) {
83
83
'upsAuth ' => $ this ->upsAuthMock ]);
84
84
}
85
85
86
+ /**
87
+ * @return void
88
+ */
89
+ public function testGetShipAcceptUrl ()
90
+ {
91
+ $ this ->assertEquals ('https://wwwcie.ups.com/ups.app/xml/ShipAccept ' , $ this ->carrier ->getShipAcceptUrl ());
92
+ }
93
+
94
+ /**
95
+ * Test ship accept url for live site
96
+ *
97
+ * @magentoConfigFixture current_store carriers/ups/is_account_live 1
98
+ */
99
+ public function testGetShipAcceptUrlLive ()
100
+ {
101
+ $ this ->assertEquals ('https://onlinetools.ups.com/ups.app/xml/ShipAccept ' , $ this ->carrier ->getShipAcceptUrl ());
102
+ }
103
+
86
104
/**
87
105
* @return void
88
106
*/
89
107
public function testGetShipConfirmUrl ()
90
108
{
91
- $ this ->assertEquals ('https://wwwcie.ups.com/api/shipments/v1/ship ' , $ this ->carrier ->getShipConfirmUrl ());
109
+ if ($ this ->carrier ->getConfigData ('type ' ) == 'UPS_XML ' ) {
110
+ $ this ->assertEquals ('https://wwwcie.ups.com/ups.app/xml/ShipConfirm ' , $ this ->carrier ->getShipConfirmUrl ());
111
+ } else {
112
+ $ this ->assertEquals ('https://wwwcie.ups.com/api/shipments/v1/ship ' , $ this ->carrier ->getShipConfirmUrl ());
113
+ }
114
+
92
115
}
93
116
94
117
/**
@@ -98,16 +121,25 @@ public function testGetShipConfirmUrl()
98
121
*/
99
122
public function testGetShipConfirmUrlLive ()
100
123
{
101
- $ this ->assertEquals (
102
- 'https://onlinetools.ups.com/api/shipments/v1/ship ' ,
103
- $ this ->carrier ->getShipConfirmUrl ()
104
- );
124
+ if ($ this ->carrier ->getConfigData ('type ' ) == 'UPS_XML ' ) {
125
+ $ this ->assertEquals (
126
+ 'https://onlinetools.ups.com/ups.app/xml/ShipConfirm ' ,
127
+ $ this ->carrier ->getShipConfirmUrl ()
128
+ );
129
+ } else {
130
+ $ this ->assertEquals (
131
+ 'https://onlinetools.ups.com/api/shipments/v1/ship ' ,
132
+ $ this ->carrier ->getShipConfirmUrl ()
133
+ );
134
+ }
135
+
105
136
}
106
137
107
138
/**
108
139
* Collect rates for UPS Ground method.
109
140
*
110
141
* @magentoConfigFixture current_store carriers/ups/active 1
142
+ * @magentoConfigFixture current_store carriers/ups/type UPS_REST
111
143
* @magentoConfigFixture current_store carriers/ups/allowed_methods 03
112
144
* @magentoConfigFixture current_store carriers/ups/free_method 03
113
145
* @magentoConfigFixture default_store carriers/ups/shipper_number 12345
@@ -168,6 +200,7 @@ public function testCollectFreeRates()
168
200
* @dataProvider collectRatesDataProvider
169
201
* @magentoConfigFixture default_store shipping/origin/country_id GB
170
202
* @magentoConfigFixture default_store carriers/ups/active 1
203
+ * @magentoConfigFixture current_store carriers/ups/type UPS_REST
171
204
* @magentoConfigFixture default_store carriers/ups/shipper_number 12345
172
205
* @magentoConfigFixture default_store carriers/ups/origin_shipment Shipments Originating in the European Union
173
206
* @magentoConfigFixture default_store carriers/ups/username user
@@ -230,6 +263,7 @@ public function testCollectRates(int $negotiable, int $tax, int $responseId, str
230
263
* @return void
231
264
* @magentoConfigFixture default_store shipping/origin/country_id GB
232
265
* @magentoConfigFixture default_store carriers/ups/active 1
266
+ * @magentoConfigFixture default_store carriers/ups/type UPS_REST
233
267
* @magentoConfigFixture default_store carriers/ups/shipper_number 12345
234
268
* @magentoConfigFixture default_store carriers/ups/origin_shipment Shipments Originating in the European Union
235
269
* @magentoConfigFixture default_store carriers/ups/username user
@@ -287,6 +321,7 @@ public function collectRatesDataProvider()
287
321
*
288
322
* @magentoConfigFixture default_store shipping/origin/country_id GB
289
323
* @magentoConfigFixture default_store carriers/ups/active 1
324
+ * @magentoConfigFixture default_store carriers/ups/type UPS_REST
290
325
* @magentoConfigFixture default_store carriers/ups/shipper_number 12345
291
326
* @magentoConfigFixture default_store carriers/ups/origin_shipment Shipments Originating in the European Union
292
327
* @magentoConfigFixture default_store carriers/ups/username user
@@ -380,6 +415,8 @@ public function testRequestToShipment(): void
380
415
*
381
416
* @magentoConfigFixture default_store shipping/origin/country_id GB
382
417
* @magentoConfigFixture default_store carriers/ups/active 1
418
+ * @magentoConfigFixture default_store carriers/ups/type UPS_REST
419
+
383
420
* @magentoConfigFixture default_store carriers/ups/shipper_number 12345
384
421
* @magentoConfigFixture default_store carriers/ups/origin_shipment Shipments Originating in the European Union
385
422
* @magentoConfigFixture default_store carriers/ups/username user
0 commit comments