Skip to content

Commit e5095c5

Browse files
committed
Add test for property aliases during deserialization
1 parent 883abd8 commit e5095c5

3 files changed

Lines changed: 107 additions & 1 deletion

File tree

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
HTTP/1.1 200 OK
2+
Access-Control-Allow-Headers: origin, x-requested-with, accept, apikey, Content-Type
3+
Access-Control-Allow-Methods: GET, POST
4+
Access-Control-Allow-Origin: *
5+
Access-Control-Max-Age: 3628800
6+
Cache-Control: private, max-age=0
7+
Content-Type: application/json;charset=UTF-8
8+
Date: Wed, 31 Mar 2021 12:24:44 GMT
9+
Strict-Transport-Security: max-age=31536000
10+
X-Content-Type-Options: nosniff
11+
X-Frame-Options: SAMEORIGIN
12+
X-Robots-Tag: noindex
13+
X-XSS-Protection: 1; mode=block
14+
Connection: keep-alive
15+
16+
17+
{
18+
"CurrentStatus": {
19+
"Shipment": {
20+
"MainBarcode": "3S8392302392342",
21+
"Barcode": "3S8392302392342",
22+
"ShipmentAmount": "1",
23+
"ShipmentCounter": "1",
24+
"Customer": {
25+
"Address": {
26+
"AddressType": "02",
27+
"City": "Den Haag",
28+
"CompanyName": "Sender Company B.V.",
29+
"Countrycode": "NL",
30+
"HouseNr": "3",
31+
"Street": "Waldorpstraat",
32+
"Zipcode": "2521CA"
33+
},
34+
"CollectionLocation": "123456",
35+
"CustomerCode": "DEVC",
36+
"CustomerNumber": "11223344",
37+
"Email": "sender@example.com"
38+
},
39+
"ProductCode": "003087",
40+
"ProductDescription": "Verhoogde Aansprakelijkheid Zending",
41+
"Reference": "ORDER-2023-001234",
42+
"Dimension": {
43+
"Height": "390",
44+
"Length": "600",
45+
"Volume": "93600",
46+
"Weight": "8820",
47+
"Width": "400"
48+
},
49+
"Amount": {
50+
"VerzekerdBedrag": "EUR800.00"
51+
},
52+
"ProductOptions": [
53+
{
54+
"OptionCode": "27",
55+
"CharacteristicCode": "122"
56+
},
57+
{
58+
"OptionCode": "17",
59+
"CharacteristicCode": "122"
60+
},
61+
{
62+
"OptionCode": "21",
63+
"CharacteristicCode": "122"
64+
},
65+
{
66+
"OptionCode": "1",
67+
"CharacteristicCode": "112"
68+
}
69+
],
70+
"Expectation": {
71+
"ETAFrom": "2023-10-11T14:35:00",
72+
"ETATo": "2023-10-11T16:35:00"
73+
},
74+
"Status": {
75+
"TimeStamp": "11-10-2023 15:32:16",
76+
"StatusCode": "11",
77+
"StatusDescription": "Zending afgeleverd",
78+
"PhaseCode": "4",
79+
"PhaseDescription": "Afgeleverd"
80+
},
81+
"Addresses": [
82+
{
83+
"AddressType": "01",
84+
"FirstName": "Jan",
85+
"LastName": "Jansen",
86+
"CompanyName": "Receiver B.V.",
87+
"Street": "Damrak",
88+
"HouseNumber": "10",
89+
"HouseNumberSuffix": "A",
90+
"Zipcode": "1012LG",
91+
"City": "Amsterdam",
92+
"CountryCode": "NL"
93+
},
94+
{
95+
"AddressType": "02",
96+
"CompanyName": "Sender Company B.V.",
97+
"Street": "Waldorpstraat",
98+
"HouseNumber": "3",
99+
"Zipcode": "2521CA",
100+
"City": "Den Haag",
101+
"CountryCode": "NL"
102+
}
103+
]
104+
}
105+
}
106+
}

tests/Service/ServiceTestCase.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public static function containsStdClass(mixed $value): bool
6363
continue;
6464
}
6565

66-
/* @noinspection PhpExpressionResultUnusedInspection */
6766
$property->setAccessible(accessible: true);
6867
if (static::containsStdClass(value: $property->getValue(object: $value))) {
6968
return true;

tests/Service/ShippingStatusServiceTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ public static function getCurrentStatusByBarcodeProvider(): array
418418
[PsrMessage::parseResponse(message: file_get_contents(filename: _RESPONSES_DIR_.'/rest/shippingstatus/currentstatus.http'))],
419419
[PsrMessage::parseResponse(message: file_get_contents(filename: _RESPONSES_DIR_.'/rest/shippingstatus/currentstatus2.http'))],
420420
[PsrMessage::parseResponse(message: file_get_contents(filename: _RESPONSES_DIR_.'/rest/shippingstatus/currentstatus3.http'))],
421+
[PsrMessage::parseResponse(message: file_get_contents(filename: _RESPONSES_DIR_.'/rest/shippingstatus/currentstatus4.http'))],
421422
];
422423
}
423424

0 commit comments

Comments
 (0)