2019-05-04 05:14:37 +02:00
|
|
|
<?php
|
2020-12-25 14:15:57 +01:00
|
|
|
|
2020-09-14 13:11:46 +02:00
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-09-14 13:11:46 +02:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
2020-12-25 14:15:57 +01:00
|
|
|
|
2019-05-04 05:14:37 +02:00
|
|
|
namespace Tests\Pdf;
|
|
|
|
|
2020-12-23 16:17:05 +01:00
|
|
|
use Beganovich\Snappdf\Snappdf;
|
2019-05-04 05:14:37 +02:00
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
//@covers App\DataMapper\BaseSettings
|
|
|
|
*/
|
|
|
|
class PdfGenerationTest extends TestCase
|
|
|
|
{
|
2020-12-25 14:15:57 +01:00
|
|
|
public function setUp(): void
|
2019-05-04 05:14:37 +02:00
|
|
|
{
|
2020-03-21 06:37:30 +01:00
|
|
|
parent::setUp();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testPdfGeneration()
|
|
|
|
{
|
2020-12-25 14:15:57 +01:00
|
|
|
$pdf = new Snappdf();
|
|
|
|
|
|
|
|
if (config('ninja.snappdf_chromium_path')) {
|
|
|
|
$pdf->setChromiumPath(config('ninja.snappdf_chromium_path'));
|
|
|
|
}
|
2019-05-04 08:55:19 +02:00
|
|
|
|
2020-12-25 14:15:57 +01:00
|
|
|
$pdf = $pdf
|
2020-12-23 16:17:05 +01:00
|
|
|
->setHtml('<h1>Invoice Ninja</h1>')
|
|
|
|
->generate();
|
2019-05-04 08:55:19 +02:00
|
|
|
|
2020-12-23 16:17:05 +01:00
|
|
|
$this->assertNotNull($pdf);
|
2020-03-21 06:37:30 +01:00
|
|
|
}
|
2019-05-04 05:14:37 +02:00
|
|
|
}
|