1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/tests/Pdf/PdfGenerationTest.php

49 lines
1.1 KiB
PHP
Raw Normal View History

2019-05-04 05:14:37 +02:00
<?php
2020-09-14 13:11:46 +02:00
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
2020-09-14 13:11:46 +02:00
*
* @license https://www.elastic.co/licensing/elastic-license
2020-09-14 13:11:46 +02: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
2023-02-21 08:39:07 +01:00
* @covers App\DataMapper\BaseSettings
2019-05-04 05:14:37 +02:00
*/
class PdfGenerationTest extends TestCase
{
protected function setUp(): void
2019-05-04 05:14:37 +02:00
{
parent::setUp();
}
public function testPdfGeneration()
{
$pdf = new Snappdf();
if (config('ninja.snappdf_chromium_path')) {
$pdf->setChromiumPath(config('ninja.snappdf_chromium_path'));
}
2019-05-04 08:55:19 +02:00
if (config('ninja.snappdf_chromium_arguments')) {
$pdf->clearChromiumArguments();
$pdf->addChromiumArguments(config('ninja.snappdf_chromium_arguments'));
}
$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);
}
2019-05-04 05:14:37 +02:00
}