mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 13:42:49 +01:00
9e9cd37b87
* Working on Quotes * Naming refactor for Quotes * Quote Actions * Quote Pdfs * Quote PDFs * Refunds in Stripe * Fixes tests * Company Ledger work
73 lines
1.6 KiB
PHP
73 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Tests\Integration;
|
|
|
|
use App\Designs\Designer;
|
|
use App\Designs\Modern;
|
|
use App\Jobs\Invoice\CreateInvoicePdf;
|
|
use App\Jobs\Quote\CreateQuotePdf;
|
|
use Tests\MockAccountData;
|
|
use Tests\TestCase;
|
|
|
|
/**
|
|
* @test
|
|
* @covers App\Designs\Designer
|
|
*/
|
|
class DesignTest extends TestCase
|
|
{
|
|
use MockAccountData;
|
|
|
|
public function setUp() :void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->makeTestData();
|
|
}
|
|
|
|
public function testInvoiceDesignExists()
|
|
{
|
|
|
|
$modern = new Modern();
|
|
|
|
$designer = new Designer($modern, $this->company->settings->pdf_variables, 'quote');
|
|
|
|
$html = $designer->build($this->invoice)->getHtml();
|
|
|
|
$this->assertNotNull($html);
|
|
|
|
//\Log::error($html);
|
|
|
|
$settings = $this->invoice->client->settings;
|
|
$settings->invoice_design_id = "4";
|
|
|
|
$this->client->settings = $settings;
|
|
$this->client->save();
|
|
|
|
CreateInvoicePdf::dispatchNow($this->invoice, $this->invoice->company, $this->invoice->client->primary_contact()->first());
|
|
}
|
|
|
|
public function testQuoteDesignExists()
|
|
{
|
|
|
|
$modern = new Modern();
|
|
|
|
$designer = new Designer($modern, $this->company->settings->pdf_variables, 'quote');
|
|
|
|
$html = $designer->build($this->quote)->getHtml();
|
|
|
|
$this->assertNotNull($html);
|
|
|
|
//\Log::error($html);
|
|
|
|
$settings = $this->invoice->client->settings;
|
|
$settings->quote_design_id = "4";
|
|
|
|
$this->client->settings = $settings;
|
|
$this->client->save();
|
|
|
|
CreateQuotePdf::dispatchNow($this->quote, $this->quote->company, $this->quote->client->primary_contact()->first());
|
|
}
|
|
|
|
}
|
|
|
|
|