Skip to content

Commit

Permalink
Added tests for saveXmlFile
Browse files Browse the repository at this point in the history
  • Loading branch information
ruff committed Jul 30, 2024
1 parent 0f2bad5 commit fc5034a
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/testcases/CiiToUblDiscountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,15 @@ public function testInvoiceLine(): void

$this->assertXPathNotExistsWithIndex('/ubl:Invoice/cac:InvoiceLine', 4);
}

public function testSaveToFile(): void
{
$filename = sys_get_temp_dir() . '/output.xml';

self::$document->saveXmlFile($filename);

$this->assertFileExists($filename);

@unlink($filename);
}
}
11 changes: 11 additions & 0 deletions tests/testcases/CiiToUblExtendedFwTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,15 @@ public function testInvoiceLine(): void

$this->assertXPathNotExistsWithIndex('/ubl:Invoice/cac:InvoiceLine', 2);
}

public function testSaveToFile(): void
{
$filename = sys_get_temp_dir() . '/output.xml';

self::$document->saveXmlFile($filename);

$this->assertFileExists($filename);

@unlink($filename);
}
}
11 changes: 11 additions & 0 deletions tests/testcases/CiiToUblExtendedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,4 +414,15 @@ public function testInvoiceLine(): void

$this->assertXPathNotExistsWithIndex('/ubl:Invoice/cac:InvoiceLine', 5);
}

public function testSaveToFile(): void
{
$filename = sys_get_temp_dir() . '/output.xml';

self::$document->saveXmlFile($filename);

$this->assertFileExists($filename);

@unlink($filename);
}
}
11 changes: 11 additions & 0 deletions tests/testcases/CiiToUblSimplePayeeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,15 @@ public function testInvoiceLine(): void

$this->assertXPathNotExistsWithIndex('/ubl:Invoice/cac:InvoiceLine', 2);
}

public function testSaveToFile(): void
{
$filename = sys_get_temp_dir() . '/output.xml';

self::$document->saveXmlFile($filename);

$this->assertFileExists($filename);

@unlink($filename);
}
}
10 changes: 10 additions & 0 deletions tests/testcases/CiiToUblSimpleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,16 @@ public function testInvoiceLine(): void
$this->assertXPathNotExistsWithIndex('/ubl:Invoice/cac:InvoiceLine/cac:Price/AllowanceCharge/cbc:BaseAmount', 1);

$this->assertXPathNotExistsWithIndex('/ubl:Invoice/cac:InvoiceLine', 2);
}

public function testSaveToFile(): void
{
$filename = sys_get_temp_dir() . '/output.xml';

self::$document->saveXmlFile($filename);

$this->assertFileExists($filename);

@unlink($filename);
}
}

0 comments on commit fc5034a

Please sign in to comment.