invoiceninja/tests/Pdf/PdfGenerationTest.php

37 lines
561 B
PHP
Raw Normal View History

2019-05-04 13:14:37 +10:00
<?php
namespace Tests\Pdf;
2019-05-04 13:17:44 +10:00
use Illuminate\Support\Facades\Storage;
2019-05-04 13:14:37 +10:00
use Spatie\Browsershot\Browsershot;
use Tests\TestCase;
/**
* @test
//@covers App\DataMapper\BaseSettings
*/
class PdfGenerationTest extends TestCase
{
public function setUp() :void
{
parent::setUp();
}
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);
$this->assertTrue(file_exists($pdf));
2019-05-04 13:17:44 +10:00
unlink($pdf);
2019-05-04 13:14:37 +10:00
}
}