invoiceninja/tests/Feature/PdfMaker/ExampleIntegrationTest.php
Benjamin Beganović cb4efc8c61 wip
2020-07-29 14:53:58 +02:00

34 lines
736 B
PHP

<?php
namespace Tests\Feature\PdfMaker;
use App\Models\Invoice;
use App\Services\PdfMaker\Designs\Plain;
use App\Services\PdfMaker\PdfMaker;
use App\Utils\HtmlEngine;
use Tests\TestCase;
class ExampleIntegrationTest extends TestCase
{
public function testExample()
{
$invoice = Invoice::first();
$invitation = $invoice->invitations()->first();
$engine = new HtmlEngine($invitation, 'invoice');
$state = [
'template' => Plain::elements(),
'variables' => $engine->generateLabelsAndValues(),
];
$maker = new PdfMaker($state);
$maker
->design(Plain::class)
->build();
// info($maker->getCompiledHTML());
}
}