mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for tests
This commit is contained in:
parent
9da8cd5399
commit
97118da600
@ -72,7 +72,7 @@ class PdfService
|
|||||||
public function getPdf()
|
public function getPdf()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$pdf = $this->resolvePdfEngine($this->getHtml());
|
$pdf = $this->init()->resolvePdfEngine($this->getHtml());
|
||||||
|
|
||||||
$numbered_pdf = $this->pageNumbering($pdf, $this->company);
|
$numbered_pdf = $this->pageNumbering($pdf, $this->company);
|
||||||
|
|
||||||
@ -95,6 +95,8 @@ class PdfService
|
|||||||
*/
|
*/
|
||||||
public function getHtml(): string
|
public function getHtml(): string
|
||||||
{
|
{
|
||||||
|
$this->init();
|
||||||
|
|
||||||
$html = $this->builder->getCompiledHTML();
|
$html = $this->builder->getCompiledHTML();
|
||||||
|
|
||||||
if (config('ninja.log_pdf_html')) {
|
if (config('ninja.log_pdf_html')) {
|
||||||
|
@ -71,7 +71,7 @@ class PdfServiceTest extends TestCase
|
|||||||
|
|
||||||
$invitation = $this->invoice->invitations->first();
|
$invitation = $this->invoice->invitations->first();
|
||||||
|
|
||||||
$service = new PdfService($invitation);
|
$service = (new PdfService($invitation))->init();
|
||||||
|
|
||||||
$this->assertInstanceOf(PdfConfiguration::class, $service->config);
|
$this->assertInstanceOf(PdfConfiguration::class, $service->config);
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ class PdfServiceTest extends TestCase
|
|||||||
{
|
{
|
||||||
$invitation = $this->invoice->invitations->first();
|
$invitation = $this->invoice->invitations->first();
|
||||||
|
|
||||||
$service = new PdfService($invitation);
|
$service = (new PdfService($invitation))->init();
|
||||||
|
|
||||||
$this->assertEquals(2, $service->config->design->id);
|
$this->assertEquals(2, $service->config->design->id);
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ class PdfServiceTest extends TestCase
|
|||||||
{
|
{
|
||||||
$invitation = $this->invoice->invitations->first();
|
$invitation = $this->invoice->invitations->first();
|
||||||
|
|
||||||
$service = new PdfService($invitation);
|
$service = (new PdfService($invitation))->init();
|
||||||
|
|
||||||
$this->assertIsArray($service->html_variables);
|
$this->assertIsArray($service->html_variables);
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ class PdfServiceTest extends TestCase
|
|||||||
{
|
{
|
||||||
$invitation = $this->invoice->invitations->first();
|
$invitation = $this->invoice->invitations->first();
|
||||||
|
|
||||||
$service = new PdfService($invitation);
|
$service = (new PdfService($invitation))->init();
|
||||||
|
|
||||||
$this->assertIsString($service->designer->template);
|
$this->assertIsString($service->designer->template);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user