mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-06 02:24:35 -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 static $casts = [
|
||||
'email_subject_purchase_order' => 'string',
|
||||
'email_template_purchase_order' => 'string',
|
||||
'require_purchase_order_signature' => 'bool',
|
||||
'purchase_order_public_notes' => 'string',
|
||||
'purchase_order_terms' => 'string',
|
||||
@ -547,6 +549,7 @@ class CompanySettings extends BaseSettings
|
||||
'invoice_design_id',
|
||||
'quote_design_id',
|
||||
'credit_design_id',
|
||||
'purchase_order_design_id',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace App\Events\Invoice;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
@ -35,12 +34,12 @@ class InvoiceWasEmailedAndFailed
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param InvoiceInvitation $invitation
|
||||
* @param $invitation
|
||||
* @param Company $company
|
||||
* @param string $errors
|
||||
* @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;
|
||||
|
||||
|
@ -179,7 +179,7 @@ class InvoiceService
|
||||
$this->invoice = (new MarkSent($this->invoice->client, $this->invoice))->run();
|
||||
|
||||
$this->setExchangeRate();
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -78,10 +78,15 @@ class CompanySettingsTest extends TestCase
|
||||
|
||||
$this->company->saveSettings($settings, $this->company);
|
||||
|
||||
try {
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-Token' => $this->token,
|
||||
])->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);
|
||||
|
||||
|
@ -13,6 +13,7 @@ namespace Tests\Integration;
|
||||
use App\Models\Credit;
|
||||
use App\Models\Design;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Models\Quote;
|
||||
use App\Models\RecurringInvoice;
|
||||
use App\Services\PdfMaker\Design as PdfDesignModel;
|
||||
@ -57,6 +58,8 @@ class HtmlGenerationTest extends TestCase
|
||||
$entity_design_id = 'quote_design_id';
|
||||
} elseif ($entity instanceof Credit) {
|
||||
$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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user