-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(consignment): add state property (#469)
* feat: add state property * feat: add state property
- Loading branch information
1 parent
021f28e
commit 3488251
Showing
4 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MyParcelNL\Sdk\Test\Model\Consignment; | ||
|
||
use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment; | ||
use MyParcelNL\Sdk\src\Model\Consignment\PostNLConsignment; | ||
use MyParcelNL\Sdk\Test\Bootstrap\TestCase; | ||
|
||
class AbstractConsignmentTest extends TestCase | ||
{ | ||
private const TEST_DATA = [ | ||
'cc' => 'NL', | ||
'city' => 'Heerhugowaard', | ||
'street' => 'Dorpsstraat', | ||
'number' => '1', | ||
'box_number' => '2', | ||
'number_suffix' => 'b', | ||
'region' => 'Noord-Holland', | ||
'state' => 'NH', | ||
'postal_code' => '1701AA', | ||
'person' => 'Pietje Puk', | ||
'package_type' => AbstractConsignment::PACKAGE_TYPE_PACKAGE, | ||
'only_recipient' => true, | ||
'signature' => true, | ||
'return' => true, | ||
'large_format' => true, | ||
'age_check' => true, | ||
'label_description' => 'Voorbeeld123', | ||
'shop_id' => 1, | ||
'status' => 99, | ||
'external_identifier' => '123456789', | ||
'barcode' => '3STOIS912345678', | ||
]; | ||
|
||
/** | ||
* @return void | ||
* @throws \MyParcelNL\Sdk\src\Exception\MissingFieldException | ||
*/ | ||
public function testAbstractConsignment(): void | ||
{ | ||
$consignment = new PostNLConsignment(); | ||
|
||
$consignment | ||
->setCountry(self::TEST_DATA['cc']) | ||
->setCity(self::TEST_DATA['city']) | ||
->setStreet(self::TEST_DATA['street']) | ||
->setNumber(self::TEST_DATA['number']) | ||
->setBoxNumber(self::TEST_DATA['box_number']) | ||
->setNumberSuffix(self::TEST_DATA['number_suffix']) | ||
->setRegion(self::TEST_DATA['region']) | ||
->setState(self::TEST_DATA['state']) | ||
->setPostalCode(self::TEST_DATA['postal_code']) | ||
->setPerson(self::TEST_DATA['person']) | ||
->setPackageType(self::TEST_DATA['package_type']) | ||
->setOnlyRecipient(self::TEST_DATA['only_recipient']) | ||
->setSignature(self::TEST_DATA['signature']) | ||
->setReturn(self::TEST_DATA['return']) | ||
->setLargeFormat(self::TEST_DATA['large_format']) | ||
->setAgeCheck(self::TEST_DATA['age_check']) | ||
->setLabelDescription(self::TEST_DATA['label_description']) | ||
->setShopId(self::TEST_DATA['shop_id']) | ||
->setStatus(self::TEST_DATA['status']) | ||
->setExternalIdentifier(self::TEST_DATA['external_identifier']) | ||
->setBarcode(self::TEST_DATA['barcode']); | ||
|
||
self::assertEquals(self::TEST_DATA['cc'], $consignment->getCountry()); | ||
self::assertEquals(self::TEST_DATA['city'], $consignment->getCity()); | ||
self::assertEquals(self::TEST_DATA['street'], $consignment->getStreet()); | ||
self::assertEquals(self::TEST_DATA['number'], $consignment->getNumber()); | ||
self::assertEquals(self::TEST_DATA['box_number'], $consignment->getBoxNumber()); | ||
self::assertEquals(self::TEST_DATA['number_suffix'], $consignment->getNumberSuffix()); | ||
self::assertEquals(self::TEST_DATA['region'], $consignment->getRegion()); | ||
self::assertEquals(self::TEST_DATA['state'], $consignment->getState()); | ||
self::assertEquals(self::TEST_DATA['postal_code'], $consignment->getPostalCode()); | ||
self::assertEquals(self::TEST_DATA['person'], $consignment->getPerson()); | ||
self::assertEquals(self::TEST_DATA['only_recipient'], $consignment->isOnlyRecipient()); | ||
self::assertEquals(self::TEST_DATA['signature'], $consignment->isSignature()); | ||
self::assertEquals(self::TEST_DATA['return'], $consignment->isReturn()); | ||
self::assertEquals(self::TEST_DATA['large_format'], $consignment->isLargeFormat()); | ||
self::assertEquals(self::TEST_DATA['age_check'], $consignment->hasAgeCheck()); | ||
self::assertEquals(self::TEST_DATA['label_description'], $consignment->getLabelDescription()); | ||
self::assertEquals(self::TEST_DATA['shop_id'], $consignment->getShopId()); | ||
self::assertEquals(self::TEST_DATA['status'], $consignment->getStatus()); | ||
self::assertEquals(self::TEST_DATA['external_identifier'], $consignment->getExternalIdentifier()); | ||
self::assertEquals(self::TEST_DATA['barcode'], $consignment->getBarcode()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters