Skip to content

Commit

Permalink
Merge pull request #105 from myparcelnl/add-insurance-100-euro
Browse files Browse the repository at this point in the history
add insurance 100 euros
  • Loading branch information
RichardPerdaan authored Jan 3, 2019
2 parents 61c5629 + 2c5b79c commit 246ea7d
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Tests/ReturnLabelTest/SendReturnLabelMailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/SendConsignments/SendDigitalStampTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Tests/SendConsignments/SendLargeFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Tests/SendConsignments/SendMailboxConsignmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Class SendMailboxConsignmentTest
* @package MyParcelNL\Sdk\tests\SendMailboxConsignmentTest
*/
class SendMailboxConsignmentTest extends \PHPUnit_Framework_TestCase
class SendMailboxConsignmentTest extends \PHPUnit\Framework\TestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/SendConsignments/SendMorningShipmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Class SendOneReferenceIdentifierConsignmentTest
* @package MyParcelNL\Sdk\tests\SendOneConsignmentTest
*/
class SendMultiReferenceIdentifierConsignmentTest extends \PHPUnit_Framework_TestCase
class SendMultiReferenceIdentifierConsignmentTest extends \PHPUnit\Framework\TestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/SendConsignments/SendMultipleConsignmentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Class SendMultipleConsignmentsTest
* @package MyParcelNL\Sdk\tests\SendConsignmentsTest
*/
class SendMultipleConsignmentsTest extends \PHPUnit_Framework_TestCase
class SendMultipleConsignmentsTest extends \PHPUnit\Framework\TestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/SendConsignments/SendNightShipmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
11 changes: 9 additions & 2 deletions Tests/SendConsignments/SendOneConsignmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Class SendOneConsignmentTest
* @package MyParcelNL\Sdk\tests\SendOneConsignmentTest
*/
class SendOneConsignmentTest extends \PHPUnit_Framework_TestCase
class SendOneConsignmentTest extends \PHPUnit\Framework\TestCase
{

/**
Expand Down Expand Up @@ -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()');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Class SendOneConsignmentWithoutEmailTest
* @package MyParcelNL\Sdk\tests\SendOneConsignmentWithoutEmailTest
*/
class SendOneConsignmentWithoutEmailTest extends \PHPUnit_Framework_TestCase
class SendOneConsignmentWithoutEmailTest extends \PHPUnit\Framework\TestCase
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Tests/SendConsignments/SendPickupFromCheckoutDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Class SendReferenceIdentifierConsignmentTest
* @package MyParcelNL\Sdk\tests\SendOneConsignmentTest
*/
class SendReferenceIdentifierConsignmentTest extends \PHPUnit_Framework_TestCase
class SendReferenceIdentifierConsignmentTest extends \PHPUnit\Framework\TestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/SendConsignments/SendUserAgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Tests/SplitStreet/InternationalFullStreetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @package MyParcelNL\Sdk\tests\InternationalFullStreetTest
*/
class InternationalFullStreetTest extends \PHPUnit_Framework_TestCase
class InternationalFullStreetTest extends \PHPUnit\Framework\TestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/SplitStreet/SplitLongStreetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Class SplitStreetTest
* @package MyParcelNL\Sdk\tests\SplitStreetTest
*/
class SplitLongStreetTest extends \PHPUnit_Framework_TestCase
class SplitLongStreetTest extends \PHPUnit\Framework\TestCase
{

/**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
6 changes: 3 additions & 3 deletions src/Model/MyParcelConsignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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()) {
Expand Down

0 comments on commit 246ea7d

Please sign in to comment.