mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-15 04:44:37 -04:00
Fixes for tests
This commit is contained in:
parent
25b48994d6
commit
21c5bdcd90
@ -289,6 +289,8 @@ class CompanySettings extends BaseSettings
|
|||||||
public $auto_archive_invoice_cancelled = false;
|
public $auto_archive_invoice_cancelled = false;
|
||||||
|
|
||||||
public static $casts = [
|
public static $casts = [
|
||||||
|
'email_subject_purchase_order' => 'string',
|
||||||
|
'email_template_purchase_order' => 'string',
|
||||||
'require_purchase_order_signature' => 'bool',
|
'require_purchase_order_signature' => 'bool',
|
||||||
'purchase_order_public_notes' => 'string',
|
'purchase_order_public_notes' => 'string',
|
||||||
'purchase_order_terms' => 'string',
|
'purchase_order_terms' => 'string',
|
||||||
@ -547,6 +549,7 @@ class CompanySettings extends BaseSettings
|
|||||||
'invoice_design_id',
|
'invoice_design_id',
|
||||||
'quote_design_id',
|
'quote_design_id',
|
||||||
'credit_design_id',
|
'credit_design_id',
|
||||||
|
'purchase_order_design_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
namespace App\Events\Invoice;
|
namespace App\Events\Invoice;
|
||||||
|
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\InvoiceInvitation;
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,12 +34,12 @@ class InvoiceWasEmailedAndFailed
|
|||||||
/**
|
/**
|
||||||
* Create a new event instance.
|
* Create a new event instance.
|
||||||
*
|
*
|
||||||
* @param InvoiceInvitation $invitation
|
* @param $invitation
|
||||||
* @param Company $company
|
* @param Company $company
|
||||||
* @param string $errors
|
* @param string $errors
|
||||||
* @param array $event_vars
|
* @param array $event_vars
|
||||||
*/
|
*/
|
||||||
public function __construct(InvoiceInvitation $invitation, Company $company, string $message, string $template, array $event_vars)
|
public function __construct($invitation, Company $company, string $message, string $template, array $event_vars)
|
||||||
{
|
{
|
||||||
$this->invitation = $invitation;
|
$this->invitation = $invitation;
|
||||||
|
|
||||||
|
@ -78,10 +78,15 @@ class CompanySettingsTest extends TestCase
|
|||||||
|
|
||||||
$this->company->saveSettings($settings, $this->company);
|
$this->company->saveSettings($settings, $this->company);
|
||||||
|
|
||||||
|
try {
|
||||||
$response = $this->withHeaders([
|
$response = $this->withHeaders([
|
||||||
'X-API-SECRET' => config('ninja.api_secret'),
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
'X-API-Token' => $this->token,
|
'X-API-Token' => $this->token,
|
||||||
])->put('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $this->company->toArray());
|
])->put('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $this->company->toArray());
|
||||||
|
} catch (ValidationException $e) {
|
||||||
|
$message = json_decode($e->validator->getMessageBag(), 1);
|
||||||
|
nlog($message);
|
||||||
|
}
|
||||||
|
|
||||||
$response->assertStatus(200);
|
$response->assertStatus(200);
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ namespace Tests\Integration;
|
|||||||
use App\Models\Credit;
|
use App\Models\Credit;
|
||||||
use App\Models\Design;
|
use App\Models\Design;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
|
use App\Models\PurchaseOrder;
|
||||||
use App\Models\Quote;
|
use App\Models\Quote;
|
||||||
use App\Models\RecurringInvoice;
|
use App\Models\RecurringInvoice;
|
||||||
use App\Services\PdfMaker\Design as PdfDesignModel;
|
use App\Services\PdfMaker\Design as PdfDesignModel;
|
||||||
@ -57,6 +58,8 @@ class HtmlGenerationTest extends TestCase
|
|||||||
$entity_design_id = 'quote_design_id';
|
$entity_design_id = 'quote_design_id';
|
||||||
} elseif ($entity instanceof Credit) {
|
} elseif ($entity instanceof Credit) {
|
||||||
$entity_design_id = 'credit_design_id';
|
$entity_design_id = 'credit_design_id';
|
||||||
|
} elseif ($entity instanceof PurchaseOrder) {
|
||||||
|
$entity_design_id = 'purchase_order_design_id';
|
||||||
}
|
}
|
||||||
|
|
||||||
$entity_design_id = $entity->design_id ? $entity->design_id : $this->decodePrimaryKey($entity->client->getSetting($entity_design_id));
|
$entity_design_id = $entity->design_id ? $entity->design_id : $this->decodePrimaryKey($entity->client->getSetting($entity_design_id));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user