diff --git a/tests/Pdf/PdfGenerationTest.php b/tests/Pdf/PdfGenerationTest.php
index e995824f4999..0aaeff7b01ca 100644
--- a/tests/Pdf/PdfGenerationTest.php
+++ b/tests/Pdf/PdfGenerationTest.php
@@ -20,16 +20,127 @@ class PdfGenerationTest extends TestCase
}
+ private function makePdf($header, $footer, $html, $pdf)
+ {
+ Browsershot::html($html)
+ //->showBrowserHeaderAndFooter()
+ //->headerHtml($header)
+ //->footerHtml($footer)
+ ->waitUntilNetworkIdle()
+ //->margins(10,10,10,10)
+ ->savePdf($pdf);
+ }
public function testPdfGeneration()
{
$html = file_get_contents(base_path().'/tests/Pdf/invoice.html');
$pdf = base_path().'/tests/Pdf/invoice.pdf';
- Browsershot::html($html)->save($pdf);
+
+ $header = '
';
+
+ $footer = '
';
+
+ $this->makePdf($header, $footer, $html, $pdf);
$this->assertTrue(file_exists($pdf));
+
+ unlink($pdf);
+
+ }
+
+ public function testPdfGeneration2()
+ {
+ $html = file_get_contents(base_path().'/tests/Pdf/invoice2.html');
+ $pdf = base_path().'/tests/Pdf/invoice2.pdf';
+
+
+ $header = '
';
+
+ $footer = '
';
+
+ $this->makePdf($header, $footer, $html, $pdf);
+
+
+ $this->assertTrue(file_exists($pdf));
+
+
+ unlink($pdf);
+
+ }
+
+ public function testPdfGeneration3()
+ {
+ $html = file_get_contents(base_path().'/tests/Pdf/invoice3.html');
+ $pdf = base_path().'/tests/Pdf/invoice3.pdf';
+
+
+ $header = '
';
+
+ $footer = '
';
+
+ $this->makePdf($header, $footer, $html, $pdf);
+
+
+ $this->assertTrue(file_exists($pdf));
+
+
+ unlink($pdf);
+
+ }
+
+ public function testPdfGeneration4()
+ {
+ $html = file_get_contents(base_path().'/tests/Pdf/invoice4.html');
+ $pdf = base_path().'/tests/Pdf/invoice4.pdf';
+
+
+ $header = '
';
+
+ $footer = '
';
+
+
+ $this->makePdf($header, $footer, $html, $pdf);
+
+
+
+ $this->assertTrue(file_exists($pdf));
+
+
+ unlink($pdf);
+
+ }
+
+
+ public function testPdfGeneration5()
+ {
+ $html = file_get_contents(base_path().'/tests/Pdf/invoice5.html');
+ $pdf = base_path().'/tests/Pdf/invoice5.pdf';
+
+
+ $header = '
';
+
+ $footer = '
';
+
+
+ $this->makePdf($header, $footer, $html, $pdf);
+
+
+
+ $this->assertTrue(file_exists($pdf));
+
+
unlink($pdf);
}
diff --git a/tests/Pdf/invoice.html b/tests/Pdf/invoice.html
index 266d4b102977..e649be5a194a 100644
--- a/tests/Pdf/invoice.html
+++ b/tests/Pdf/invoice.html
@@ -5,6 +5,10 @@
A simple, clean, and responsive HTML invoice template
+
+
+
+
+
+
+
+
INVOICE TO:
+
John Doe
+
796 Silver Harbour, TX 79273, US
+
+
+
+
INVOICE 3-2-1
+
Date of Invoice: 01/06/2014
+
Due Date: 30/06/2014
+
+
+
+
+
+ # |
+ DESCRIPTION |
+ UNIT PRICE |
+ QUANTITY |
+ TOTAL |
+
+
+
+
+ 01 |
+ Website DesignCreating a recognizable design solution based on the company's existing visual identity |
+ $40.00 |
+ 30 |
+ $1,200.00 |
+
+
+ 02 |
+ Website DevelopmentDeveloping a Content Management System-based Website |
+ $40.00 |
+ 80 |
+ $3,200.00 |
+
+
+ 03 |
+ Search Engines OptimizationOptimize the site for search engines (SEO) |
+ $40.00 |
+ 20 |
+ $800.00 |
+
+
+
+
+ |
+ SUBTOTAL |
+ $5,200.00 |
+
+
+ |
+ TAX 25% |
+ $1,300.00 |
+
+
+ |
+ GRAND TOTAL |
+ $6,500.00 |
+
+
+
+ Thank you!
+
+
NOTICE:
+
A finance charge of 1.5% will be made on unpaid balances after 30 days.
+
+
+
+
+