@@ -83,12 +83,35 @@ function (string $message) {
8383 'upsAuth ' => $ this ->upsAuthMock ]);
8484 }
8585
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+
86104 /**
87105 * @return void
88106 */
89107 public function testGetShipConfirmUrl ()
90108 {
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+
92115 }
93116
94117 /**
@@ -98,16 +121,25 @@ public function testGetShipConfirmUrl()
98121 */
99122 public function testGetShipConfirmUrlLive ()
100123 {
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+
105136 }
106137
107138 /**
108139 * Collect rates for UPS Ground method.
109140 *
110141 * @magentoConfigFixture current_store carriers/ups/active 1
142+ * @magentoConfigFixture current_store carriers/ups/type UPS_REST
111143 * @magentoConfigFixture current_store carriers/ups/allowed_methods 03
112144 * @magentoConfigFixture current_store carriers/ups/free_method 03
113145 * @magentoConfigFixture default_store carriers/ups/shipper_number 12345
@@ -168,6 +200,7 @@ public function testCollectFreeRates()
168200 * @dataProvider collectRatesDataProvider
169201 * @magentoConfigFixture default_store shipping/origin/country_id GB
170202 * @magentoConfigFixture default_store carriers/ups/active 1
203+ * @magentoConfigFixture current_store carriers/ups/type UPS_REST
171204 * @magentoConfigFixture default_store carriers/ups/shipper_number 12345
172205 * @magentoConfigFixture default_store carriers/ups/origin_shipment Shipments Originating in the European Union
173206 * @magentoConfigFixture default_store carriers/ups/username user
@@ -230,6 +263,7 @@ public function testCollectRates(int $negotiable, int $tax, int $responseId, str
230263 * @return void
231264 * @magentoConfigFixture default_store shipping/origin/country_id GB
232265 * @magentoConfigFixture default_store carriers/ups/active 1
266+ * @magentoConfigFixture default_store carriers/ups/type UPS_REST
233267 * @magentoConfigFixture default_store carriers/ups/shipper_number 12345
234268 * @magentoConfigFixture default_store carriers/ups/origin_shipment Shipments Originating in the European Union
235269 * @magentoConfigFixture default_store carriers/ups/username user
@@ -287,6 +321,7 @@ public function collectRatesDataProvider()
287321 *
288322 * @magentoConfigFixture default_store shipping/origin/country_id GB
289323 * @magentoConfigFixture default_store carriers/ups/active 1
324+ * @magentoConfigFixture default_store carriers/ups/type UPS_REST
290325 * @magentoConfigFixture default_store carriers/ups/shipper_number 12345
291326 * @magentoConfigFixture default_store carriers/ups/origin_shipment Shipments Originating in the European Union
292327 * @magentoConfigFixture default_store carriers/ups/username user
@@ -380,6 +415,8 @@ public function testRequestToShipment(): void
380415 *
381416 * @magentoConfigFixture default_store shipping/origin/country_id GB
382417 * @magentoConfigFixture default_store carriers/ups/active 1
418+ * @magentoConfigFixture default_store carriers/ups/type UPS_REST
419+
383420 * @magentoConfigFixture default_store carriers/ups/shipper_number 12345
384421 * @magentoConfigFixture default_store carriers/ups/origin_shipment Shipments Originating in the European Union
385422 * @magentoConfigFixture default_store carriers/ups/username user
0 commit comments