Skip to content

Commit

Permalink
Added test coverage for xml special characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
firebed committed Oct 16, 2024
1 parent 292602b commit 470a939
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/InvoiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ public function test_invoice_validation()
$this->assertEmpty($invoice->validate(), "Validation failed: ".print_r($invoice->validate(), true));
}

public function test_invoice_special_characters()
{
$invoice = Invoice::factory()->make();
$invoice->getInvoiceDetails()[0]->setItemDescr("<Πλακάκια> & Είδη Υγιεινής");

$xml = $invoice->toXml();
$this->assertStringContainsString("<itemDescr>&lt;Πλακάκια&gt; &amp; Είδη Υγιεινής</itemDescr>", $xml);
}

public function test_invoice_validation_fail()
{
$invoice = Invoice::factory()->make();
Expand Down

0 comments on commit 470a939

Please sign in to comment.