From d229db156adcdce48b3e6345efcfa6542d8f9320 Mon Sep 17 00:00:00 2001 From: Richard Perdaan Date: Thu, 3 Jan 2019 11:05:55 +0100 Subject: [PATCH 1/3] add insurance 100 euros --- Tests/SendConsignments/SendOneConsignmentTest.php | 9 ++++++++- src/Model/MyParcelConsignment.php | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Tests/SendConsignments/SendOneConsignmentTest.php b/Tests/SendConsignments/SendOneConsignmentTest.php index 4f3dc1c0..36258fd1 100755 --- a/Tests/SendConsignments/SendOneConsignmentTest.php +++ b/Tests/SendConsignments/SendOneConsignmentTest.php @@ -126,7 +126,14 @@ public function testSendOneConsignment() } if (key_exists('insurance', $consignmentTest)) { - $this->assertEquals($consignmentTest['insurance'], $consignment->getInsurance(), 'getInsurance()'); + // Since 1-1-2019 it is not possible to get an insurance with 50 euros from MyParcel, instead the insurance 100 euros has been added. + $insurance = $consignmentTest['insurance']; + + if ($insurance == 50) { + $insurance = 100; + } + + $this->assertEquals($insurance, $consignment->getInsurance(), 'getInsurance()'); } /** diff --git a/src/Model/MyParcelConsignment.php b/src/Model/MyParcelConsignment.php index 7356d646..e5ec66c0 100755 --- a/src/Model/MyParcelConsignment.php +++ b/src/Model/MyParcelConsignment.php @@ -37,7 +37,7 @@ class MyParcelConsignment const CC_NL = 'NL'; const CC_BE = 'BE'; - private $insurance_possibilities = [0, 50, 250, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000]; + private $insurance_possibilities = [0, 50, 100, 250, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000]; /** * @var string @@ -989,7 +989,7 @@ public function getInsurance() * * Composite type containing integer and currency. The amount is without decimal * separators. - * Pattern: [0, 50, 250, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000] + * Pattern: [0, 50, 100, 250, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000] * Required: No * * @param int $insurance @@ -1000,7 +1000,7 @@ public function getInsurance() public function setInsurance($insurance) { if (!in_array($insurance, $this->insurance_possibilities) && $this->getCountry() == self::CC_NL) { - throw new \Exception('Insurance must be one of [0, 50, 250, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000]'); + throw new \Exception('Insurance must be one of [0, 50, 100, 250, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000]'); } if (!$this->canHaveOption()) { From dada1e5c844584c7984dd36b5fa3ed380d2f53d9 Mon Sep 17 00:00:00 2001 From: Richard Perdaan Date: Thu, 3 Jan 2019 11:23:59 +0100 Subject: [PATCH 2/3] change extends to \PHPUnit\Framework\TestCase --- Tests/SendConsignments/SendMailboxConsignmentTest.php | 2 +- .../SendMultiReferenceIdentifierConsignmentTest.php | 2 +- Tests/SendConsignments/SendOneConsignmentTest.php | 2 +- Tests/SendConsignments/SendOneInternationalConsignmentTest.php | 2 +- Tests/SendConsignments/SendUserAgentTest.php | 2 +- Tests/SplitStreet/SplitLongStreetTest.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/SendConsignments/SendMailboxConsignmentTest.php b/Tests/SendConsignments/SendMailboxConsignmentTest.php index cd32fc56..b3f3aa30 100755 --- a/Tests/SendConsignments/SendMailboxConsignmentTest.php +++ b/Tests/SendConsignments/SendMailboxConsignmentTest.php @@ -23,7 +23,7 @@ * Class SendMailboxConsignmentTest * @package MyParcelNL\Sdk\tests\SendMailboxConsignmentTest */ -class SendMailboxConsignmentTest extends \PHPUnit_Framework_TestCase +class SendMailboxConsignmentTest extends \PHPUnit\Framework\TestCase { /** diff --git a/Tests/SendConsignments/SendMultiReferenceIdentifierConsignmentTest.php b/Tests/SendConsignments/SendMultiReferenceIdentifierConsignmentTest.php index df50a777..4687ddb2 100755 --- a/Tests/SendConsignments/SendMultiReferenceIdentifierConsignmentTest.php +++ b/Tests/SendConsignments/SendMultiReferenceIdentifierConsignmentTest.php @@ -23,7 +23,7 @@ * Class SendOneReferenceIdentifierConsignmentTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentTest */ -class SendMultiReferenceIdentifierConsignmentTest extends \PHPUnit_Framework_TestCase +class SendMultiReferenceIdentifierConsignmentTest extends \PHPUnit\Framework\TestCase { /** diff --git a/Tests/SendConsignments/SendOneConsignmentTest.php b/Tests/SendConsignments/SendOneConsignmentTest.php index 36258fd1..7c523dad 100755 --- a/Tests/SendConsignments/SendOneConsignmentTest.php +++ b/Tests/SendConsignments/SendOneConsignmentTest.php @@ -23,7 +23,7 @@ * Class SendOneConsignmentTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentTest */ -class SendOneConsignmentTest extends \PHPUnit_Framework_TestCase +class SendOneConsignmentTest extends \PHPUnit\Framework\TestCase { /** diff --git a/Tests/SendConsignments/SendOneInternationalConsignmentTest.php b/Tests/SendConsignments/SendOneInternationalConsignmentTest.php index ccbbb8fd..a89efbf2 100755 --- a/Tests/SendConsignments/SendOneInternationalConsignmentTest.php +++ b/Tests/SendConsignments/SendOneInternationalConsignmentTest.php @@ -25,7 +25,7 @@ * Class SendOneInternationalConsignmentTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentTest */ -class SendOneInternationalConsignmentTest extends \PHPUnit_Framework_TestCase +class SendOneInternationalConsignmentTest extends \PHPUnit\Framework\TestCase { use HasCustomItems; diff --git a/Tests/SendConsignments/SendUserAgentTest.php b/Tests/SendConsignments/SendUserAgentTest.php index c218e3c5..821f4498 100755 --- a/Tests/SendConsignments/SendUserAgentTest.php +++ b/Tests/SendConsignments/SendUserAgentTest.php @@ -23,7 +23,7 @@ * Class SendPickupFromCheckoutDataTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentTest */ -class SendUserAgentTest extends \PHPUnit_Framework_TestCase +class SendUserAgentTest extends \PHPUnit\Framework\TestCase { /** * Test one shipment with createConcepts() diff --git a/Tests/SplitStreet/SplitLongStreetTest.php b/Tests/SplitStreet/SplitLongStreetTest.php index 9945ec32..8559fae0 100755 --- a/Tests/SplitStreet/SplitLongStreetTest.php +++ b/Tests/SplitStreet/SplitLongStreetTest.php @@ -22,7 +22,7 @@ * Class SplitStreetTest * @package MyParcelNL\Sdk\tests\SplitStreetTest */ -class SplitLongStreetTest extends \PHPUnit_Framework_TestCase +class SplitLongStreetTest extends \PHPUnit\Framework\TestCase { /** From 2c5b79cc8aca2c8ae4e839712068b1729234bbcd Mon Sep 17 00:00:00 2001 From: Richard Perdaan Date: Thu, 3 Jan 2019 11:25:03 +0100 Subject: [PATCH 3/3] change composer version --- Tests/ReturnLabelTest/SendReturnLabelMailTest.php | 2 +- Tests/SendConsignments/SendDigitalStampTest.php | 2 +- Tests/SendConsignments/SendLargeFormatTest.php | 2 +- Tests/SendConsignments/SendMorningShipmentTest.php | 2 +- Tests/SendConsignments/SendMultipleConsignmentsTest.php | 2 +- Tests/SendConsignments/SendNightShipmentTest.php | 2 +- Tests/SendConsignments/SendOneConsignmentWithoutEmailTest.php | 2 +- Tests/SendConsignments/SendPickupFromCheckoutDataTest.php | 2 +- .../SendConsignments/SendReferenceIdentifierConsignmentTest.php | 2 +- Tests/SplitStreet/InternationalFullStreetTest.php | 2 +- composer.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/ReturnLabelTest/SendReturnLabelMailTest.php b/Tests/ReturnLabelTest/SendReturnLabelMailTest.php index e5da0cc6..c423082d 100644 --- a/Tests/ReturnLabelTest/SendReturnLabelMailTest.php +++ b/Tests/ReturnLabelTest/SendReturnLabelMailTest.php @@ -21,7 +21,7 @@ use MyParcelNL\Sdk\src\Helper\MyParcelCollection; use MyParcelNL\Sdk\src\Model\Repository\MyParcelConsignmentRepository; -class SendReturnLabelMailTest extends \PHPUnit_Framework_TestCase +class SendReturnLabelMailTest extends \PHPUnit\Framework\TestCase { public function testSendReturnLabelMail() { diff --git a/Tests/SendConsignments/SendDigitalStampTest.php b/Tests/SendConsignments/SendDigitalStampTest.php index 80b3ee9e..f5c1bd9b 100644 --- a/Tests/SendConsignments/SendDigitalStampTest.php +++ b/Tests/SendConsignments/SendDigitalStampTest.php @@ -9,7 +9,7 @@ * Class SendDigitalStampTest * @package MyParcelNL\Sdk\tests\SendDigitalStampTest */ -class SendDigitalStampTest extends \PHPUnit_Framework_TestCase +class SendDigitalStampTest extends \PHPUnit\Framework\TestCase { use HasCustomItems; diff --git a/Tests/SendConsignments/SendLargeFormatTest.php b/Tests/SendConsignments/SendLargeFormatTest.php index f51cdce1..36098fcb 100755 --- a/Tests/SendConsignments/SendLargeFormatTest.php +++ b/Tests/SendConsignments/SendLargeFormatTest.php @@ -24,7 +24,7 @@ * Class SendOneInternationalConsignmentTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentTest */ -class SendLargeFormatTest extends \PHPUnit_Framework_TestCase +class SendLargeFormatTest extends \PHPUnit\Framework\TestCase { use HasCustomItems; diff --git a/Tests/SendConsignments/SendMorningShipmentTest.php b/Tests/SendConsignments/SendMorningShipmentTest.php index f013e6c2..256739af 100755 --- a/Tests/SendConsignments/SendMorningShipmentTest.php +++ b/Tests/SendConsignments/SendMorningShipmentTest.php @@ -23,7 +23,7 @@ * Class SendMorningShipmentTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentTest */ -class SendMorningShipmentTest extends \PHPUnit_Framework_TestCase +class SendMorningShipmentTest extends \PHPUnit\Framework\TestCase { /** * Test one shipment with createConcepts() diff --git a/Tests/SendConsignments/SendMultipleConsignmentsTest.php b/Tests/SendConsignments/SendMultipleConsignmentsTest.php index a9f7bdc7..6abbc9d7 100755 --- a/Tests/SendConsignments/SendMultipleConsignmentsTest.php +++ b/Tests/SendConsignments/SendMultipleConsignmentsTest.php @@ -24,7 +24,7 @@ * Class SendMultipleConsignmentsTest * @package MyParcelNL\Sdk\tests\SendConsignmentsTest */ -class SendMultipleConsignmentsTest extends \PHPUnit_Framework_TestCase +class SendMultipleConsignmentsTest extends \PHPUnit\Framework\TestCase { /** diff --git a/Tests/SendConsignments/SendNightShipmentTest.php b/Tests/SendConsignments/SendNightShipmentTest.php index e085bd6c..04f36936 100755 --- a/Tests/SendConsignments/SendNightShipmentTest.php +++ b/Tests/SendConsignments/SendNightShipmentTest.php @@ -23,7 +23,7 @@ * Class SendNightShipmentTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentTest */ -class SendNightShipmentTest extends \PHPUnit_Framework_TestCase +class SendNightShipmentTest extends \PHPUnit\Framework\TestCase { /** * Test one shipment with createConcepts() diff --git a/Tests/SendConsignments/SendOneConsignmentWithoutEmailTest.php b/Tests/SendConsignments/SendOneConsignmentWithoutEmailTest.php index fc96bbea..507438fc 100644 --- a/Tests/SendConsignments/SendOneConsignmentWithoutEmailTest.php +++ b/Tests/SendConsignments/SendOneConsignmentWithoutEmailTest.php @@ -22,7 +22,7 @@ * Class SendOneConsignmentWithoutEmailTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentWithoutEmailTest */ -class SendOneConsignmentWithoutEmailTest extends \PHPUnit_Framework_TestCase +class SendOneConsignmentWithoutEmailTest extends \PHPUnit\Framework\TestCase { /** diff --git a/Tests/SendConsignments/SendPickupFromCheckoutDataTest.php b/Tests/SendConsignments/SendPickupFromCheckoutDataTest.php index 61dac432..087f2fa9 100755 --- a/Tests/SendConsignments/SendPickupFromCheckoutDataTest.php +++ b/Tests/SendConsignments/SendPickupFromCheckoutDataTest.php @@ -23,7 +23,7 @@ * Class SendPickupFromCheckoutDataTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentTest */ -class SendPickupFromCheckoutDataTest extends \PHPUnit_Framework_TestCase +class SendPickupFromCheckoutDataTest extends \PHPUnit\Framework\TestCase { /** * Test one shipment with createConcepts() diff --git a/Tests/SendConsignments/SendReferenceIdentifierConsignmentTest.php b/Tests/SendConsignments/SendReferenceIdentifierConsignmentTest.php index 6d647f02..f265f020 100755 --- a/Tests/SendConsignments/SendReferenceIdentifierConsignmentTest.php +++ b/Tests/SendConsignments/SendReferenceIdentifierConsignmentTest.php @@ -23,7 +23,7 @@ * Class SendReferenceIdentifierConsignmentTest * @package MyParcelNL\Sdk\tests\SendOneConsignmentTest */ -class SendReferenceIdentifierConsignmentTest extends \PHPUnit_Framework_TestCase +class SendReferenceIdentifierConsignmentTest extends \PHPUnit\Framework\TestCase { /** diff --git a/Tests/SplitStreet/InternationalFullStreetTest.php b/Tests/SplitStreet/InternationalFullStreetTest.php index 33b3b4cc..69895d4e 100755 --- a/Tests/SplitStreet/InternationalFullStreetTest.php +++ b/Tests/SplitStreet/InternationalFullStreetTest.php @@ -24,7 +24,7 @@ * * @package MyParcelNL\Sdk\tests\InternationalFullStreetTest */ -class InternationalFullStreetTest extends \PHPUnit_Framework_TestCase +class InternationalFullStreetTest extends \PHPUnit\Framework\TestCase { /** diff --git a/composer.json b/composer.json index e1934326..9efbff0d 100755 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "myparcelnl/sdk", - "version": "v1.5.0", + "version": "v1.5.1", "description": "This package is designed to send and receive data from MyParcel by means of an API.", "homepage": "https://www.myparcel.nl", "tags": ["MyParcel", "My Parcel", "Post NL", "PostNL"],