Skip to content

Commit

Permalink
[ENH] Improved PDF-Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Dec 9, 2024
1 parent 3ed50a4 commit 9aaebf3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/testcases/PdfBuilderEn16931Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,33 @@ public function testPdfMetaData(): void
$this->assertArrayHasKey("Producer", $pdfDetails); //"FPDF 1.84"
$this->assertArrayHasKey("CreationDate", $pdfDetails); //"2020-12-09T05:19:39+00:00"
$this->assertArrayHasKey("Pages", $pdfDetails); //"1"
$this->assertArrayHasKey("fx:documenttype", $pdfDetails);
$this->assertArrayHasKey("fx:documentfilename", $pdfDetails);
$this->assertArrayHasKey("fx:version", $pdfDetails);
$this->assertArrayHasKey("fx:conformancelevel", $pdfDetails);
$this->assertArrayHasKey("pdfaid:part", $pdfDetails);
$this->assertArrayHasKey("pdfaid:conformance", $pdfDetails);
$this->assertArrayHasKey("dc:title", $pdfDetails);
$this->assertArrayHasKey("dc:creator", $pdfDetails);
$this->assertArrayHasKey("dc:description", $pdfDetails);
$this->assertArrayHasKey("xmp:creatortool", $pdfDetails);
$this->assertArrayHasKey("xmp:createdate", $pdfDetails);
$this->assertArrayHasKey("xmp:modifydate", $pdfDetails);
$this->assertStringContainsString('FPDF', $pdfDetails["Producer"]);
$this->assertStringContainsString(date("Y-m-d"), $pdfDetails["CreationDate"]);
$this->assertEquals("1", $pdfDetails["Pages"]);
$this->assertEquals("INVOICE", $pdfDetails["fx:documenttype"]);
$this->assertEquals("factur-x.xml", $pdfDetails["fx:documentfilename"]);
$this->assertEquals("1.0", $pdfDetails["fx:version"]);
$this->assertEquals("EN 16931", $pdfDetails["fx:conformancelevel"]);
$this->assertEquals("3", $pdfDetails["pdfaid:part"]);
$this->assertEquals("B", $pdfDetails["pdfaid:conformance"]);
$this->assertEquals("Lieferant GmbH : Invoice 471102", $pdfDetails["dc:title"]);
$this->assertEquals("Lieferant GmbH", $pdfDetails["dc:creator"]);
$this->assertEquals("FacturX/ZUGFeRD Invoice 471102 dated 2018-03-05 issued by Lieferant GmbH", $pdfDetails["dc:description"]);
$this->assertStringContainsString('Factur-X PHP library', $pdfDetails["xmp:creatortool"]);
$this->assertEquals("2018-03-05T00:00:00+00:00", $pdfDetails["xmp:createdate"]);
$this->assertStringContainsString(date("Y-m-d"), $pdfDetails["xmp:modifydate"]);
}

public function testSetAdditionalCreatorTool(): void
Expand Down

0 comments on commit 9aaebf3

Please sign in to comment.