1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/tests/Feature/PdfMaker/ExampleIntegrationTest.php

37 lines
770 B
PHP
Raw Normal View History

2020-07-29 13:37:05 +02:00
<?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' => [
],
'variables' => $engine->generateLabelsAndValues(),
];
$maker = new PdfMaker($state);
$maker
->design(Plain::class)
->build();
info($state);
info($maker->getCompiledHTML());
}
}