PluginProbe
Packeta / 2.1
Packeta v2.1
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / tests / Core / Entity / CustomsDeclarationTest.php

CustomsDeclarationTest.php in Packeta 2.1, at tests/Core/Entity/CustomsDeclarationTest.php

73 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare( strict_types=1 );
4
5 namespace Tests\Core\Entity;
6
7 use Packetery\Core\CoreHelper;
8 use PHPUnit\Framework\TestCase;
9 use Tests\Core\DummyFactory;
10
11 class CustomsDeclarationTest extends TestCase {
12
13 private const DUMMY_FILE_CONTENT = 'Dummy file content';
14
15 public function testSettersAndGetters(): void {
16 $customsDeclaration = DummyFactory::createCustomsDeclaration();
17
18 $dummyId = 'dummyId';
19 $customsDeclaration->setId( $dummyId );
20 self::assertSame( $dummyId, $customsDeclaration->getId() );
21
22 $dummyDeliveryCost = 124.5;
23 $customsDeclaration->setDeliveryCost( $dummyDeliveryCost );
24 self::assertSame( $dummyDeliveryCost, $customsDeclaration->getDeliveryCost() );
25
26 self::assertNull( $customsDeclaration->getEadFile() );
27 $dummyEad = 'dummyEad';
28 $customsDeclaration->setEad( $dummyEad );
29 self::assertSame( $dummyEad, $customsDeclaration->getEad() );
30
31 $customsDeclaration->setEadFile(
32 function () {
33 return self::DUMMY_FILE_CONTENT;
34 },
35 true
36 );
37 self::assertSame( self::DUMMY_FILE_CONTENT, $customsDeclaration->getEadFile() );
38 self::assertTrue( $customsDeclaration->hasEadFileContent() );
39
40 $dummyEadFileId = 'dummyEadFileId';
41 $customsDeclaration->setEadFileId( $dummyEadFileId );
42 self::assertSame( $dummyEadFileId, $customsDeclaration->getEadFileId() );
43
44 self::assertNull( $customsDeclaration->getInvoiceFile() );
45 $customsDeclaration->setInvoiceFile(
46 function () {
47 return self::DUMMY_FILE_CONTENT;
48 },
49 true
50 );
51 self::assertSame( self::DUMMY_FILE_CONTENT, $customsDeclaration->getInvoiceFile() );
52 self::assertTrue( $customsDeclaration->hasInvoiceFileContent() );
53
54 $dummyInvoiceFileId = 'dummyInvoiceFileId';
55 $customsDeclaration->setInvoiceFileId( $dummyInvoiceFileId );
56 self::assertSame( $dummyInvoiceFileId, $customsDeclaration->getInvoiceFileId() );
57
58 $dummyInvoiceIssueDate = CoreHelper::now();
59 $customsDeclaration->setInvoiceIssueDate( $dummyInvoiceIssueDate );
60 self::assertSame( $dummyInvoiceIssueDate, $customsDeclaration->getInvoiceIssueDate() );
61
62 $dummyInvoiceNumber = 'dummyInvoiceNumber';
63 $customsDeclaration->setInvoiceNumber( $dummyInvoiceNumber );
64 self::assertSame( $dummyInvoiceNumber, $customsDeclaration->getInvoiceNumber() );
65
66 $dummyMrn = 'dummyMrn';
67 $customsDeclaration->setMrn( $dummyMrn );
68 self::assertSame( $dummyMrn, $customsDeclaration->getMrn() );
69
70 self::assertIsString( $customsDeclaration->getOrderId() );
71 }
72 }
73