diff --git a/tests/BuilderEn16931Test.php b/tests/BuilderEn16931Test.php index 17fb9d15..dfe74f20 100644 --- a/tests/BuilderEn16931Test.php +++ b/tests/BuilderEn16931Test.php @@ -15,10 +15,10 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } public function testXmlGenerals(): void @@ -29,7 +29,7 @@ public function testXmlGenerals(): void $this->disableRenderXmlContent(); $this->assertArrayHasKey("rsm", $namespaces); $this->assertArrayHasKey("ram", $namespaces); - $this->assertXPathValue('/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID', (self::$document)->profiledef["contextparameter"]); + $this->assertXPathValue('/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID', (self::$document)->profileDefinition["contextparameter"]); } /** diff --git a/tests/BuilderExtendedTest.php b/tests/BuilderExtendedTest.php index 3d749f09..4e7a6013 100644 --- a/tests/BuilderExtendedTest.php +++ b/tests/BuilderExtendedTest.php @@ -15,10 +15,10 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } public function testXmlGenerals(): void @@ -29,7 +29,7 @@ public function testXmlGenerals(): void $this->disableRenderXmlContent(); $this->assertArrayHasKey("rsm", $namespaces); $this->assertArrayHasKey("ram", $namespaces); - $this->assertXPathValue('/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID', (self::$document)->profiledef["contextparameter"]); + $this->assertXPathValue('/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID', (self::$document)->profileDefinition["contextparameter"]); } /** diff --git a/tests/DocumentTest.php b/tests/DocumentTest.php index 5af1adc5..48ee53c7 100644 --- a/tests/DocumentTest.php +++ b/tests/DocumentTest.php @@ -16,11 +16,11 @@ public function testDocumentCreationBasic(): void { $doc = new ZugferdDocument(ZugferdProfiles::PROFILE_BASIC); $this->assertNotNull($doc); - $this->assertEquals(ZugferdProfiles::PROFILE_BASIC, $doc->profile); - $this->assertArrayHasKey("contextparameter", $doc->profiledef); - $this->assertArrayHasKey("name", $doc->profiledef); - $this->assertEquals("urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic", $doc->profiledef["contextparameter"]); - $this->assertEquals("basic", $doc->profiledef["name"]); + $this->assertEquals(ZugferdProfiles::PROFILE_BASIC, $doc->profileId); + $this->assertArrayHasKey("contextparameter", $doc->profileDefinition); + $this->assertArrayHasKey("name", $doc->profileDefinition); + $this->assertEquals("urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic", $doc->profileDefinition["contextparameter"]); + $this->assertEquals("basic", $doc->profileDefinition["name"]); } /** @@ -30,11 +30,11 @@ public function testDocumentCreationBasicWl(): void { $doc = new ZugferdDocument(ZugferdProfiles::PROFILE_BASICWL); $this->assertNotNull($doc); - $this->assertEquals(ZugferdProfiles::PROFILE_BASICWL, $doc->profile); - $this->assertArrayHasKey("contextparameter", $doc->profiledef); - $this->assertArrayHasKey("name", $doc->profiledef); - $this->assertEquals("urn:factur-x.eu:1p0:basicwl", $doc->profiledef["contextparameter"]); - $this->assertEquals("basicwl", $doc->profiledef["name"]); + $this->assertEquals(ZugferdProfiles::PROFILE_BASICWL, $doc->profileId); + $this->assertArrayHasKey("contextparameter", $doc->profileDefinition); + $this->assertArrayHasKey("name", $doc->profileDefinition); + $this->assertEquals("urn:factur-x.eu:1p0:basicwl", $doc->profileDefinition["contextparameter"]); + $this->assertEquals("basicwl", $doc->profileDefinition["name"]); } /** @@ -44,11 +44,11 @@ public function testDocumentCreationEn16931(): void { $doc = new ZugferdDocument(ZugferdProfiles::PROFILE_EN16931); $this->assertNotNull($doc); - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, $doc->profile); - $this->assertArrayHasKey("contextparameter", $doc->profiledef); - $this->assertArrayHasKey("name", $doc->profiledef); - $this->assertEquals("urn:cen.eu:en16931:2017", $doc->profiledef["contextparameter"]); - $this->assertEquals("en16931", $doc->profiledef["name"]); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, $doc->profileId); + $this->assertArrayHasKey("contextparameter", $doc->profileDefinition); + $this->assertArrayHasKey("name", $doc->profileDefinition); + $this->assertEquals("urn:cen.eu:en16931:2017", $doc->profileDefinition["contextparameter"]); + $this->assertEquals("en16931", $doc->profileDefinition["name"]); } /** @@ -58,11 +58,11 @@ public function testDocumentCreationExtended(): void { $doc = new ZugferdDocument(ZugferdProfiles::PROFILE_EXTENDED); $this->assertNotNull($doc); - $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, $doc->profile); - $this->assertArrayHasKey("contextparameter", $doc->profiledef); - $this->assertArrayHasKey("name", $doc->profiledef); - $this->assertEquals("urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended", $doc->profiledef["contextparameter"]); - $this->assertEquals("extended", $doc->profiledef["name"]); + $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, $doc->profileId); + $this->assertArrayHasKey("contextparameter", $doc->profileDefinition); + $this->assertArrayHasKey("name", $doc->profileDefinition); + $this->assertEquals("urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended", $doc->profileDefinition["contextparameter"]); + $this->assertEquals("extended", $doc->profileDefinition["name"]); } /** diff --git a/tests/PdfBuilderEn16931Test.php b/tests/PdfBuilderEn16931Test.php index 573a9cba..bd875e5c 100644 --- a/tests/PdfBuilderEn16931Test.php +++ b/tests/PdfBuilderEn16931Test.php @@ -105,10 +105,10 @@ public function testReadPdf(): void $document = ZugferdDocumentPdfReader::readAndGuessFromFile(self::$destPdfFilename); $this->assertNotNull($document); - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, $document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, $document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, $document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, $document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, $document->profile); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, $document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, $document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, $document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, $document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, $document->profileId); } } diff --git a/tests/PdfReaderEn16931AllowanceChargeTest.php b/tests/PdfReaderEn16931AllowanceChargeTest.php index 2d243dff..6d4841eb 100644 --- a/tests/PdfReaderEn16931AllowanceChargeTest.php +++ b/tests/PdfReaderEn16931AllowanceChargeTest.php @@ -25,11 +25,11 @@ public function testCanReadPdf(): void public function testDocumentProfile(): void { - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profile); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profileId); } /** @@ -223,8 +223,9 @@ public function testDocumentSellerContact(): void { $this->assertFalse(self::$document->firstDocumentSellerContact()); $this->assertFalse(self::$document->nextDocumentSellerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + }); } /** @@ -297,8 +298,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -369,8 +371,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -441,8 +444,9 @@ public function testDocumentShipToContact(): void { $this->assertFalse(self::$document->firstDocumentShipToContact()); $this->assertFalse(self::$document->nextDocumentShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + }); } /** @@ -512,11 +516,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -586,11 +592,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -660,11 +668,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -734,11 +744,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -808,11 +820,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -887,8 +901,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/PdfReaderEn16931SimpleTest.php b/tests/PdfReaderEn16931SimpleTest.php index 00f7f41e..af284838 100644 --- a/tests/PdfReaderEn16931SimpleTest.php +++ b/tests/PdfReaderEn16931SimpleTest.php @@ -25,11 +25,11 @@ public function testCanReadPdf(): void public function testDocumentProfile(): void { - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profile); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profileId); } /** @@ -215,8 +215,9 @@ public function testDocumentSellerContact(): void { $this->assertFalse(self::$document->firstDocumentSellerContact()); $this->assertFalse(self::$document->nextDocumentSellerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + }); } /** @@ -289,8 +290,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -361,8 +363,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -433,8 +436,9 @@ public function testDocumentShipToContact(): void { $this->assertFalse(self::$document->firstDocumentShipToContact()); $this->assertFalse(self::$document->nextDocumentShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + }); } /** @@ -504,11 +508,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -578,11 +584,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -652,11 +660,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -726,11 +736,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -800,11 +812,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -879,8 +893,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/PdfReaderExtended2Test.php b/tests/PdfReaderExtended2Test.php index 46806fe0..ec242476 100644 --- a/tests/PdfReaderExtended2Test.php +++ b/tests/PdfReaderExtended2Test.php @@ -25,10 +25,10 @@ public function testCanReadPdf(): void public function testDocumentProfile(): void { - $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } /** @@ -207,8 +207,9 @@ public function testDocumentSellerContact(): void { $this->assertFalse(self::$document->firstDocumentSellerContact()); $this->assertFalse(self::$document->nextDocumentSellerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + }); } /** @@ -286,8 +287,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -358,8 +360,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -431,8 +434,9 @@ public function testDocumentShipToContact(): void { $this->assertFalse(self::$document->firstDocumentShipToContact()); $this->assertFalse(self::$document->nextDocumentShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + }); } /** @@ -502,11 +506,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -576,11 +582,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -650,11 +658,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -724,11 +734,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -798,11 +810,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -877,8 +891,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/PdfReaderExtendedTest.php b/tests/PdfReaderExtendedTest.php index 99668155..18192642 100644 --- a/tests/PdfReaderExtendedTest.php +++ b/tests/PdfReaderExtendedTest.php @@ -25,11 +25,11 @@ public function testCanReadPdf(): void public function testDocumentProfile(): void { - $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profile); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profileId); } /** @@ -298,8 +298,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -370,8 +371,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -517,11 +519,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -591,11 +595,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -665,11 +671,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -742,11 +750,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -816,11 +826,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -895,8 +907,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/PdfReaderMultipleAttachmentsTest.php b/tests/PdfReaderMultipleAttachmentsTest.php index 624517a0..9543ed9e 100644 --- a/tests/PdfReaderMultipleAttachmentsTest.php +++ b/tests/PdfReaderMultipleAttachmentsTest.php @@ -24,11 +24,11 @@ public function testCanReadPdf(): void public function testDocumentProfile(): void { - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profile); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profileId); } /** diff --git a/tests/PdfReaderXRechnungSimpleTest.php b/tests/PdfReaderXRechnungSimpleTest.php index 1885908f..eeb5d256 100644 --- a/tests/PdfReaderXRechnungSimpleTest.php +++ b/tests/PdfReaderXRechnungSimpleTest.php @@ -25,11 +25,11 @@ public function testCanReadPdf(): void public function testDocumentProfile(): void { - $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); - $this->assertEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profile); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); + $this->assertEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profileId); } /** @@ -292,8 +292,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -364,8 +365,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -436,8 +438,9 @@ public function testDocumentShipToContact(): void { $this->assertFalse(self::$document->firstDocumentShipToContact()); $this->assertFalse(self::$document->nextDocumentShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + }); } /** @@ -507,11 +510,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -581,11 +586,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -655,11 +662,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -729,11 +738,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -803,11 +814,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -882,8 +895,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/ReaderBasicSimpleTest.php b/tests/ReaderBasicSimpleTest.php index f5b5e534..1ac56c01 100644 --- a/tests/ReaderBasicSimpleTest.php +++ b/tests/ReaderBasicSimpleTest.php @@ -20,10 +20,10 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } /** @@ -207,8 +207,9 @@ public function testDocumentSellerContact(): void { $this->assertFalse(self::$document->firstDocumentSellerContact()); $this->assertFalse(self::$document->nextDocumentSellerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + }); } /** @@ -280,8 +281,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -352,8 +354,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -424,8 +427,9 @@ public function testDocumentShipToContact(): void { $this->assertFalse(self::$document->firstDocumentShipToContact()); $this->assertFalse(self::$document->nextDocumentShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + }); } /** @@ -495,11 +499,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -569,11 +575,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -643,11 +651,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -717,11 +727,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -791,11 +803,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -870,8 +884,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/ReaderEn16931AllowanceChargeTest.php b/tests/ReaderEn16931AllowanceChargeTest.php index 3a9b64e1..392a7fc7 100644 --- a/tests/ReaderEn16931AllowanceChargeTest.php +++ b/tests/ReaderEn16931AllowanceChargeTest.php @@ -20,10 +20,10 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } /** @@ -217,8 +217,9 @@ public function testDocumentSellerContact(): void { $this->assertFalse(self::$document->firstDocumentSellerContact()); $this->assertFalse(self::$document->nextDocumentSellerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + }); } /** @@ -291,8 +292,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -363,8 +365,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -435,8 +438,9 @@ public function testDocumentShipToContact(): void { $this->assertFalse(self::$document->firstDocumentShipToContact()); $this->assertFalse(self::$document->nextDocumentShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + }); } /** @@ -506,11 +510,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -580,11 +586,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -654,11 +662,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -728,11 +738,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -802,11 +814,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -881,8 +895,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/ReaderEn16931Bank1Test.php b/tests/ReaderEn16931Bank1Test.php index 88e63018..159ef0b7 100644 --- a/tests/ReaderEn16931Bank1Test.php +++ b/tests/ReaderEn16931Bank1Test.php @@ -21,10 +21,10 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } /** diff --git a/tests/ReaderEn16931Bank2Test.php b/tests/ReaderEn16931Bank2Test.php index 6a255ef3..1f38841c 100644 --- a/tests/ReaderEn16931Bank2Test.php +++ b/tests/ReaderEn16931Bank2Test.php @@ -21,10 +21,10 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } /** @@ -190,7 +190,8 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } } diff --git a/tests/ReaderEn16931SimpleTest.php b/tests/ReaderEn16931SimpleTest.php index 48f3c687..19fbbf10 100644 --- a/tests/ReaderEn16931SimpleTest.php +++ b/tests/ReaderEn16931SimpleTest.php @@ -20,10 +20,10 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } /** @@ -209,8 +209,9 @@ public function testDocumentSellerContact(): void { $this->assertFalse(self::$document->firstDocumentSellerContact()); $this->assertFalse(self::$document->nextDocumentSellerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + }); } /** @@ -283,8 +284,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -355,8 +357,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -427,8 +430,9 @@ public function testDocumentShipToContact(): void { $this->assertFalse(self::$document->firstDocumentShipToContact()); $this->assertFalse(self::$document->nextDocumentShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + }); } /** @@ -498,11 +502,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -572,11 +578,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -646,11 +654,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -720,11 +730,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -794,11 +806,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -873,8 +887,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/ReaderExtended2Test.php b/tests/ReaderExtended2Test.php index cb2369e6..79dd4465 100644 --- a/tests/ReaderExtended2Test.php +++ b/tests/ReaderExtended2Test.php @@ -20,10 +20,10 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } /** @@ -202,8 +202,9 @@ public function testDocumentSellerContact(): void { $this->assertFalse(self::$document->firstDocumentSellerContact()); $this->assertFalse(self::$document->nextDocumentSellerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerContact($sellercontactpersonname, $sellercontactdepartmentname, $sellercontactphoneno, $sellercontactfaxno, $sellercontactemailaddr); + }); } /** @@ -281,8 +282,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -353,8 +355,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -426,8 +429,9 @@ public function testDocumentShipToContact(): void { $this->assertFalse(self::$document->firstDocumentShipToContact()); $this->assertFalse(self::$document->nextDocumentShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + }); } /** @@ -497,11 +501,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -571,11 +577,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -645,11 +653,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -719,11 +729,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -793,11 +805,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -872,8 +886,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/ReaderExtendedTest.php b/tests/ReaderExtendedTest.php index ec1ffc64..60790e90 100644 --- a/tests/ReaderExtendedTest.php +++ b/tests/ReaderExtendedTest.php @@ -20,10 +20,10 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); } /** @@ -301,8 +301,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -373,8 +374,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -520,11 +522,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -594,11 +598,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -668,11 +674,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -745,11 +753,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -819,11 +829,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -898,8 +910,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/ReaderXRechnungAttachedBinaryObjectTest.php b/tests/ReaderXRechnungAttachedBinaryObjectTest.php index 1d59edb5..d135cb42 100644 --- a/tests/ReaderXRechnungAttachedBinaryObjectTest.php +++ b/tests/ReaderXRechnungAttachedBinaryObjectTest.php @@ -20,12 +20,12 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profile); - $this->assertEquals(ZugferdProfiles::PROFILE_XRECHNUNG_2, self::$document->profile); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profileId); + $this->assertEquals(ZugferdProfiles::PROFILE_XRECHNUNG_2, self::$document->profileId); } /** diff --git a/tests/ReaderXRechnungSimpleTest.php b/tests/ReaderXRechnungSimpleTest.php index b371ff75..110aaee5 100644 --- a/tests/ReaderXRechnungSimpleTest.php +++ b/tests/ReaderXRechnungSimpleTest.php @@ -20,11 +20,11 @@ public static function setUpBeforeClass(): void public function testDocumentProfile(): void { - $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profile); - $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profile); - $this->assertEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profile); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EN16931, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASIC, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_BASICWL, self::$document->profileId); + $this->assertNotEquals(ZugferdProfiles::PROFILE_EXTENDED, self::$document->profileId); + $this->assertEquals(ZugferdProfiles::PROFILE_XRECHNUNG, self::$document->profileId); } /** @@ -287,8 +287,9 @@ public function testDocumentBuyerContact(): void { $this->assertFalse(self::$document->firstDocumentBuyerContact()); $this->assertFalse(self::$document->nextDocumentBuyerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentBuyerContact($buyercontactpersonname, $buyercontactdepartmentname, $buyercontactphoneno, $buyercontactfaxno, $buyercontactemailaddr); + }); } /** @@ -359,8 +360,9 @@ public function testDocumentSellerTaxRepresentativeContact(): void { $this->assertFalse(self::$document->firstDocumentSellerTaxRepresentativeContact()); $this->assertFalse(self::$document->nextDocumentSellerTaxRepresentativeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentSellerTaxRepresentativeContact($sellertaxreprcontactpersonname, $sellertaxreprcontactdepartmentname, $sellertaxreprcontactphoneno, $sellertaxreprcontactfaxno, $sellertaxreprcontactemailaddr); + }); } /** @@ -431,8 +433,9 @@ public function testDocumentShipToContact(): void { $this->assertFalse(self::$document->firstDocumentShipToContact()); $this->assertFalse(self::$document->nextDocumentShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipToContact($shiptocontactpersonname, $shiptocontactdepartmentname, $shiptocontactphoneno, $shiptocontactfaxno, $shiptocontactemailaddr); + }); } /** @@ -502,11 +505,13 @@ public function testDocumentUltimateShipToLegalOrganization(): void public function testDocumentUltimateShipToContact(): void { $this->assertFalse(self::$document->firstDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentUltimateShipToContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentUltimateShipToContact($ultimateshiptocontactpersonname, $ultimateshiptocontactdepartmentname, $ultimateshiptocontactphoneno, $ultimateshiptocontactfaxno, $ultimateshiptocontactemailaddr); + }); } /** @@ -576,11 +581,13 @@ public function testDocumentShipFromLegalOrganization(): void public function testDocumentShipFromContact(): void { $this->assertFalse(self::$document->firstDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentShipFromContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentShipFromContact($shipfromcontactpersonname, $shipfromcontactdepartmentname, $shipfromcontactphoneno, $shipfromcontactfaxno, $shipfromcontactemailaddr); + }); } /** @@ -650,11 +657,13 @@ public function testDocumentInvoicerLegalOrganization(): void public function testDocumentInvoicerContact(): void { $this->assertFalse(self::$document->firstDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoicerContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoicerContact($invoicercontactpersonname, $invoicercontactdepartmentname, $invoicercontactphoneno, $invoicercontactfaxno, $invoicercontactemailaddr); + }); } /** @@ -724,11 +733,13 @@ public function testDocumentInvoiceeLegalOrganization(): void public function testDocumentInvoiceeContact(): void { $this->assertFalse(self::$document->firstDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentInvoiceeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentInvoiceeContact($invoiceecontactpersonname, $invoiceecontactdepartmentname, $invoiceecontactphoneno, $invoiceecontactfaxno, $invoiceecontactemailaddr); + }); } /** @@ -798,11 +809,13 @@ public function testDocumentPayeeLegalOrganization(): void public function testDocumentPayeeContact(): void { $this->assertFalse(self::$document->firstDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentPayeeContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + $this->expectNoticeOrWarningExt(function() { + self::$document->getDocumentPayeeContact($payeecontactpersonname, $payeecontactdepartmentname, $payeecontactphoneno, $payeecontactfaxno, $payeecontactemailaddr); + }); } /** @@ -877,8 +890,9 @@ public function testDocumentProductEndUserLegalOrganization(): void public function testDocumentProductEndUserContact(): void { $this->assertFalse(self::$document->firstDocumentProductEndUserContactContact()); - $this->expectNoticeOrWarning(); - self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + $this->expectNoticeOrWarningExt(function () { + self::$document->getDocumentProductEndUserContact($producendusercontactpersonname, $producendusercontactdepartmentname, $producendusercontactphoneno, $producendusercontactfaxno, $producendusercontactemailaddr); + }); $this->assertFalse(self::$document->nextDocumentProductEndUserContactContact()); } diff --git a/tests/TestCase.php b/tests/TestCase.php index 9883300e..a8286dcc 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -20,4 +20,23 @@ public function expectNoticeOrWarning(): void $this->expectNotice(); } } -} \ No newline at end of file + + /** + * Use this with PHPunit 10 + * + * @param \Closure $run + * @return void + */ + public function expectNoticeOrWarningExt(\Closure $run): void + { + set_error_handler(static function (int $errno, string $errstr): never { + throw new \Exception($errstr, $errno); + }, E_ALL); + + $this->expectException(\Exception::class); + + call_user_func($run); + + restore_error_handler(); + } +}