Skip to content

Commit 61adc50

Browse files
committed
service on saturday test
1 parent d7b832a commit 61adc50

File tree

1 file changed

+45
-9
lines changed

1 file changed

+45
-9
lines changed

tests/unit/ServicesTest.php

+45-9
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,28 @@ class ServicesTest extends TestCase
4040
],
4141
];
4242

43+
private $parcels4 = [
44+
0 => [
45+
'content' => 'ulotki',
46+
'weight' => 1,
47+
],
48+
1 => [
49+
'content' => 'katalogi',
50+
'weight' => 18,
51+
],
52+
];
53+
54+
private $parcels5 = [
55+
0 => [
56+
'content' => 'broszury',
57+
'weight' => 1,
58+
],
59+
1 => [
60+
'content' => 'ulotki',
61+
'weight' => 12,
62+
],
63+
];
64+
4365
private $receiver = [
4466
'company' => 'ABC Sp. z o.o.',
4567
'name' => 'Jan Kowalski',
@@ -76,7 +98,7 @@ class ServicesTest extends TestCase
7698
];
7799

78100

79-
/* public function test_add_packages_with_services()
101+
public function test_add_packages_with_services()
80102
{
81103
$dpd = new DPDService();
82104
$dpd->setSender($this->sender);
@@ -105,15 +127,32 @@ class ServicesTest extends TestCase
105127
$services4 = [
106128
'inpers' => '',
107129
'carryin'
108-
];
130+
];
131+
132+
$services5 = [
133+
'guarantee' => [
134+
'type' => 'SATURDAY'
135+
]
136+
];
109137

110138
$packages = [];
111139

112140
// prepare packages
141+
142+
// service with declared value
113143
array_push($packages, $dpd->createPackage($this->parcels, $this->receiver, 'SENDER', $services1, 'REF123'));
144+
145+
// service with delivery time
114146
array_push($packages, $dpd->createPackage($this->parcels2, $this->receiver, 'SENDER', $services2, 'REF456'));
147+
148+
// service with cod
115149
array_push($packages, $dpd->createPackage($this->parcels3, $this->receiver, 'SENDER', $services3, 'REF789'));
116-
array_push($packages, $dpd->createPackage($this->parcels3, $this->receiver, 'SENDER', $services4));
150+
151+
// service with caution
152+
array_push($packages, $dpd->createPackage($this->parcels4, $this->receiver, 'SENDER', $services4));
153+
154+
// service with delivery in saturday
155+
array_push($packages, $dpd->createPackage($this->parcels5, $this->receiver, 'SENDER', $services5, 'REF1010'));
117156

118157
$result = $dpd->sendPackages($packages);
119158

@@ -149,7 +188,6 @@ class ServicesTest extends TestCase
149188

150189
$pickup = $dpd->pickupRequest([$protocol->documentId], $pickupDate, $pickupTimeFrom, $pickupTimeTo, $contactInfo, $this->pickupAddress);
151190

152-
153191
}
154192

155193
public function test_add_package()
@@ -225,12 +263,9 @@ public function test_add_packages()
225263

226264
$pickup = $dpd->pickupRequest([$protocol->documentId], $pickupDate, $pickupTimeFrom, $pickupTimeTo, $contactInfo, $this->pickupAddress);
227265

228-
229266
}
230267

231268

232-
233-
234269
public function test_post_code()
235270
{
236271
$dpd = new DPDService();
@@ -248,9 +283,10 @@ public function test_post_code()
248283
$this->assertTrue(isset($pc4->status) && $pc4->status == 'OK');
249284

250285
$pc5 = $dpd->checkPostCode('00-000');
251-
$this->assertFalse(isset($pc5->status) && $pc5->status == 'OK');
286+
$this->assertFalse(isset($pc5->status) && $pc5->status == 'OK');
287+
252288

253-
}*/
289+
}
254290

255291
public function test_courier_availability()
256292
{

0 commit comments

Comments
 (0)