Skip to content

Commit 94ed0d0

Browse files
committed
validation fix
1 parent 538b4a6 commit 94ed0d0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/DPDService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function createPackage(array $parcels, array $receiver, $payer = 'SENDER'
166166
else
167167
$ref = str_split($ref, 9);
168168

169-
if (strtoupper($payer) != 'SENDER' || strtoupper($payer) != 'RECEIVER')
169+
if (strtoupper($payer) != 'SENDER' && strtoupper($payer) != 'RECEIVER')
170170
throw new \Exception('Wrong payer type (SENDER or RECEIVER)', 104);
171171

172172
$package = [

tests/unit/ServicesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function test_add_package()
8383

8484
//send package
8585
$result = $dpd->sendPackage($this->parcels, $this->receiver, 'SENDER');
86-
$this->assertTrue(isset($result->parcels) && count($result->parcels) == 2);
86+
$this->assertTrue(isset($result->parcels) && !is_null($result->parcels) && count($result->parcels) == 2);
8787

8888
// generate speedlabel in default, pdf/a4 format
8989
$speedlabel = $dpd->generateSpeedLabelsByPackageIds([$result->packageId], $this->pickupAddress);

0 commit comments

Comments
 (0)