Skip to content

Commit 49e26db

Browse files
author
Graham Wharton
committed
Updated Carrier Test to be broadly inline with 2.3-develop.
There are differences in the DHL API version that is used between 2.2 and 2.3 branches, therefore there had to be some modifications to the tests. Unfortunately it means it is difficult to readacross directly to 2.3 tests.
1 parent ce7b560 commit 49e26db

8 files changed

+1119
-210
lines changed

app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php

Lines changed: 222 additions & 181 deletions
Large diffs are not rendered by default.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<req:ShipmentValidateRequestAP xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com ship-val-req_AP.xsd">
9+
<Request xmlns="">
10+
<ServiceHeader>
11+
<SiteID>some ID</SiteID>
12+
<Password>some password</Password>
13+
</ServiceHeader>
14+
</Request>
15+
<LanguageCode xmlns="">EN</LanguageCode>
16+
<PiecesEnabled xmlns="">Y</PiecesEnabled>
17+
<Billing xmlns="">
18+
<ShipperAccountNumber>1234567890</ShipperAccountNumber>
19+
<ShippingPaymentType>S</ShippingPaymentType>
20+
<BillingAccountNumber>1234567890</BillingAccountNumber>
21+
<DutyPaymentType>S</DutyPaymentType>
22+
<DutyAccountNumber>1234567890</DutyAccountNumber>
23+
</Billing>
24+
<Consignee xmlns="">
25+
<CompanyName/>
26+
<AddressLine/>
27+
<City/>
28+
<PostalCode/>
29+
<CountryCode/>
30+
<CountryName/>
31+
<Contact>
32+
<PersonName/>
33+
<PhoneNumber/>
34+
</Contact>
35+
</Consignee>
36+
<Commodity xmlns="">
37+
<CommodityCode>1</CommodityCode>
38+
</Commodity>
39+
<Dutiable xmlns="">
40+
<DeclaredValue>10.00</DeclaredValue>
41+
<DeclaredCurrency>USD</DeclaredCurrency>
42+
</Dutiable>
43+
<Reference xmlns="">
44+
<ReferenceID>shipment reference</ReferenceID>
45+
<ReferenceType>St</ReferenceType>
46+
</Reference>
47+
<ShipmentDetails xmlns="">
48+
<NumberOfPieces>1</NumberOfPieces>
49+
<CurrencyCode>USD</CurrencyCode>
50+
<Pieces xmlns="">
51+
<Piece xmlns="">
52+
<PieceID>1</PieceID>
53+
<PackageType>CP</PackageType>
54+
<Weight>0.5</Weight>
55+
<Depth>3</Depth>
56+
<Width>3</Width>
57+
<Height>3</Height>
58+
<PieceContents>item_name</PieceContents>
59+
</Piece>
60+
</Pieces>
61+
<PackageType>CP</PackageType>
62+
<Weight>0.454</Weight>
63+
<DimensionUnit>C</DimensionUnit>
64+
<WeightUnit>K</WeightUnit>
65+
<GlobalProductCode/>
66+
<LocalProductCode/>
67+
<DoorTo>DD</DoorTo>
68+
<Date/>
69+
<Contents>DHL Parcel TEST</Contents>
70+
</ShipmentDetails>
71+
<Shipper xmlns="">
72+
<ShipperID>1234567890</ShipperID>
73+
<CompanyName/>
74+
<AddressLine/>
75+
<City/>
76+
<PostalCode/>
77+
<CountryCode/>
78+
<CountryName/>
79+
<Contact xmlns="">
80+
<PersonName/>
81+
<PhoneNumber/>
82+
</Contact>
83+
</Shipper>
84+
<LabelImageFormat xmlns="">PDF</LabelImageFormat>
85+
</req:ShipmentValidateRequestAP>

app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0"?>
22
<!--
33
/**
44
* Copyright © Magento, Inc. All rights reserved.
@@ -83,7 +83,7 @@
8383
<currency>EUR</currency>
8484
<weight_unit>KG</weight_unit>
8585
<measure_unit>CM</measure_unit>
86-
<region>EA</region>
86+
<region>EU</region>
8787
<name>Austria</name>
8888
<domestic>1</domestic>
8989
</AT>
@@ -132,7 +132,7 @@
132132
<currency>EUR</currency>
133133
<weight_unit>KG</weight_unit>
134134
<measure_unit>CM</measure_unit>
135-
<region>EA</region>
135+
<region>EU</region>
136136
<name>Belgium</name>
137137
<domestic>1</domestic>
138138
</BE>
@@ -146,7 +146,7 @@
146146
<currency>BGN</currency>
147147
<weight_unit>KG</weight_unit>
148148
<measure_unit>CM</measure_unit>
149-
<region>EA</region>
149+
<region>EU</region>
150150
<name>Bulgaria</name>
151151
<domestic>1</domestic>
152152
</BG>
@@ -257,7 +257,7 @@
257257
<currency>CHF</currency>
258258
<weight_unit>KG</weight_unit>
259259
<measure_unit>CM</measure_unit>
260-
<region>EA</region>
260+
<region>EU</region>
261261
<name>Switzerland</name>
262262
</CH>
263263
<CI>
@@ -331,15 +331,15 @@
331331
<currency>CZK</currency>
332332
<weight_unit>KG</weight_unit>
333333
<measure_unit>CM</measure_unit>
334-
<region>EA</region>
334+
<region>EU</region>
335335
<name>Czech Republic, The</name>
336336
<domestic>1</domestic>
337337
</CZ>
338338
<DE>
339339
<currency>EUR</currency>
340340
<weight_unit>KG</weight_unit>
341341
<measure_unit>CM</measure_unit>
342-
<region>EA</region>
342+
<region>EU</region>
343343
<name>Germany</name>
344344
<domestic>1</domestic>
345345
</DE>
@@ -353,7 +353,7 @@
353353
<currency>DKK</currency>
354354
<weight_unit>KG</weight_unit>
355355
<measure_unit>CM</measure_unit>
356-
<region>EA</region>
356+
<region>EU</region>
357357
<name>Denmark</name>
358358
<domestic>1</domestic>
359359
</DK>
@@ -389,7 +389,7 @@
389389
<currency>EEK</currency>
390390
<weight_unit>KG</weight_unit>
391391
<measure_unit>CM</measure_unit>
392-
<region>EA</region>
392+
<region>EU</region>
393393
<name>Estonia</name>
394394
<domestic>1</domestic>
395395
</EE>
@@ -410,7 +410,7 @@
410410
<currency>EUR</currency>
411411
<weight_unit>KG</weight_unit>
412412
<measure_unit>CM</measure_unit>
413-
<region>EA</region>
413+
<region>EU</region>
414414
<name>Spain</name>
415415
<domestic>1</domestic>
416416
</ES>
@@ -424,7 +424,7 @@
424424
<currency>EUR</currency>
425425
<weight_unit>KG</weight_unit>
426426
<measure_unit>CM</measure_unit>
427-
<region>EA</region>
427+
<region>EU</region>
428428
<name>Finland</name>
429429
<domestic>1</domestic>
430430
</FI>
@@ -457,7 +457,7 @@
457457
<currency>EUR</currency>
458458
<weight_unit>KG</weight_unit>
459459
<measure_unit>CM</measure_unit>
460-
<region>EA</region>
460+
<region>EU</region>
461461
<name>France</name>
462462
<domestic>1</domestic>
463463
</FR>
@@ -471,7 +471,7 @@
471471
<currency>GBP</currency>
472472
<weight_unit>KG</weight_unit>
473473
<measure_unit>CM</measure_unit>
474-
<region>EA</region>
474+
<region>EU</region>
475475
<name>United Kingdom</name>
476476
<domestic>1</domestic>
477477
</GB>
@@ -549,7 +549,7 @@
549549
<currency>EUR</currency>
550550
<weight_unit>KG</weight_unit>
551551
<measure_unit>CM</measure_unit>
552-
<region>EA</region>
552+
<region>EU</region>
553553
<name>Greece</name>
554554
<domestic>1</domestic>
555555
</GR>
@@ -612,7 +612,7 @@
612612
<currency>HUF</currency>
613613
<weight_unit>KG</weight_unit>
614614
<measure_unit>CM</measure_unit>
615-
<region>EA</region>
615+
<region>EU</region>
616616
<name>Hungary</name>
617617
<domestic>1</domestic>
618618
</HU>
@@ -633,7 +633,7 @@
633633
<currency>EUR</currency>
634634
<weight_unit>KG</weight_unit>
635635
<measure_unit>CM</measure_unit>
636-
<region>EA</region>
636+
<region>EU</region>
637637
<name>Ireland, Republic Of</name>
638638
<domestic>1</domestic>
639639
</IE>
@@ -668,14 +668,14 @@
668668
<currency>ISK</currency>
669669
<weight_unit>KG</weight_unit>
670670
<measure_unit>CM</measure_unit>
671-
<region>EA</region>
671+
<region>EU</region>
672672
<name>Iceland</name>
673673
</IS>
674674
<IT>
675675
<currency>EUR</currency>
676676
<weight_unit>KG</weight_unit>
677677
<measure_unit>CM</measure_unit>
678-
<region>EA</region>
678+
<region>EU</region>
679679
<name>Italy</name>
680680
<domestic>1</domestic>
681681
</IT>
@@ -834,23 +834,23 @@
834834
<currency>LTL</currency>
835835
<weight_unit>KG</weight_unit>
836836
<measure_unit>CM</measure_unit>
837-
<region>EA</region>
837+
<region>EU</region>
838838
<name>Lithuania</name>
839839
<domestic>1</domestic>
840840
</LT>
841841
<LU>
842842
<currency>EUR</currency>
843843
<weight_unit>KG</weight_unit>
844844
<measure_unit>CM</measure_unit>
845-
<region>EA</region>
845+
<region>EU</region>
846846
<name>Luxembourg</name>
847847
<domestic>1</domestic>
848848
</LU>
849849
<LV>
850850
<currency>LVL</currency>
851851
<weight_unit>KG</weight_unit>
852852
<measure_unit>CM</measure_unit>
853-
<region>EA</region>
853+
<region>EU</region>
854854
<name>Latvia</name>
855855
<domestic>1</domestic>
856856
</LV>
@@ -1039,15 +1039,15 @@
10391039
<currency>EUR</currency>
10401040
<weight_unit>KG</weight_unit>
10411041
<measure_unit>CM</measure_unit>
1042-
<region>EA</region>
1042+
<region>EU</region>
10431043
<name>Netherlands, The</name>
10441044
<domestic>1</domestic>
10451045
</NL>
10461046
<NO>
10471047
<currency>NOK</currency>
10481048
<weight_unit>KG</weight_unit>
10491049
<measure_unit>CM</measure_unit>
1050-
<region>EA</region>
1050+
<region>EU</region>
10511051
<name>Norway</name>
10521052
</NO>
10531053
<NP>
@@ -1127,7 +1127,7 @@
11271127
<currency>PLN</currency>
11281128
<weight_unit>KG</weight_unit>
11291129
<measure_unit>CM</measure_unit>
1130-
<region>EA</region>
1130+
<region>EU</region>
11311131
<name>Poland</name>
11321132
<domestic>1</domestic>
11331133
</PL>
@@ -1142,7 +1142,7 @@
11421142
<currency>EUR</currency>
11431143
<weight_unit>KG</weight_unit>
11441144
<measure_unit>CM</measure_unit>
1145-
<region>EA</region>
1145+
<region>EU</region>
11461146
<name>Portugal</name>
11471147
<domestic>1</domestic>
11481148
</PT>
@@ -1177,7 +1177,7 @@
11771177
<currency>RON</currency>
11781178
<weight_unit>KG</weight_unit>
11791179
<measure_unit>CM</measure_unit>
1180-
<region>EA</region>
1180+
<region>EU</region>
11811181
<name>Romania</name>
11821182
<domestic>1</domestic>
11831183
</RO>
@@ -1231,7 +1231,7 @@
12311231
<currency>SEK</currency>
12321232
<weight_unit>KG</weight_unit>
12331233
<measure_unit>CM</measure_unit>
1234-
<region>EA</region>
1234+
<region>EU</region>
12351235
<name>Sweden</name>
12361236
<domestic>1</domestic>
12371237
</SE>
@@ -1246,15 +1246,15 @@
12461246
<currency>EUR</currency>
12471247
<weight_unit>KG</weight_unit>
12481248
<measure_unit>CM</measure_unit>
1249-
<region>EA</region>
1249+
<region>EU</region>
12501250
<name>Slovenia</name>
12511251
<domestic>1</domestic>
12521252
</SI>
12531253
<SK>
12541254
<currency>EUR</currency>
12551255
<weight_unit>KG</weight_unit>
12561256
<measure_unit>CM</measure_unit>
1257-
<region>EA</region>
1257+
<region>EU</region>
12581258
<name>Slovakia</name>
12591259
<domestic>1</domestic>
12601260
</SK>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
return [
7+
'data' => [
8+
'dest_country_id' => 'DE',
9+
'dest_region_id' => '82',
10+
'dest_region_code' => 'BER',
11+
'dest_street' => 'Turmstraße 17',
12+
'dest_city' => 'Berlin',
13+
'dest_postcode' => '10559',
14+
'dest_postal' => '10559',
15+
'package_value' => '5',
16+
'package_value_with_discount' => '5',
17+
'package_weight' => '8.2657',
18+
'package_qty' => '1',
19+
'package_physical_value' => '5',
20+
'free_method_weight' => '5',
21+
'store_id' => '1',
22+
'website_id' => '1',
23+
'free_shipping' => '0',
24+
'limit_carrier' => null,
25+
'base_subtotal_incl_tax' => '5',
26+
'orig_country_id' => 'US',
27+
'orig_region_id' => '12',
28+
'orig_city' => 'Fremont',
29+
'orig_postcode' => '94538',
30+
'dhl_id' => 'MAGEN_8501',
31+
'dhl_password' => 'QR2GO1U74X',
32+
'dhl_account' => '799909537',
33+
'dhl_shipping_intl_key' => '54233F2B2C4E5C4B4C5E5A59565530554B405641475D5659',
34+
'girth' => null,
35+
'height' => null,
36+
'length' => null,
37+
'width' => null,
38+
'weight' => 1,
39+
'dhl_shipment_type' => 'P',
40+
'dhl_duitable' => 0,
41+
'dhl_duty_payment_type' => 'R',
42+
'dhl_content_desc' => 'Big Box',
43+
'limit_method' => 'IE',
44+
'ship_date' => '2014-01-09',
45+
'action' => 'RateEstimate',
46+
'all_items' => [],
47+
]
48+
];

0 commit comments

Comments
 (0)