mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-01 21:00:58 +00:00
* refactor: stabilize model identities for domain migration * refactor: extract module platform context * refactor: assign models to domain contexts * refactor: extract ai platform context * refactor: extract storage platform context * refactor: extract mail platform context * refactor: extract pdf platform context * refactor: extract operations platform context * refactor: move installation into operations platform * refactor: extract money domain context * refactor: extract taxation domain context * refactor: extract catalog domain context * refactor: extract metadata domain context * refactor: extract reporting domain context * refactor: extract purchases domain context * refactor: extract receivables domain context * refactor: extract accounts domain context * refactor: complete reporting statement boundary * refactor: extract contacts domain context * refactor: extract sales domain context * refactor: remove legacy application layers * fix: migrate legacy bouncer role identities
60 lines
1.6 KiB
PHP
60 lines
1.6 KiB
PHP
<?php
|
|
|
|
use App\Domains\Sales\Models\Estimate;
|
|
use App\Domains\Sales\Models\EstimateItem;
|
|
use App\Domains\Sales\Models\Invoice;
|
|
use App\Domains\Sales\Models\InvoiceItem;
|
|
use App\Domains\Taxation\Models\Tax;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
beforeEach(function () {
|
|
Artisan::call('db:seed', ['--class' => 'DatabaseSeeder', '--force' => true]);
|
|
Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
|
|
});
|
|
|
|
test('tax belongs to tax type', function () {
|
|
$tax = Tax::factory()->create();
|
|
|
|
$this->assertTrue($tax->taxType->exists());
|
|
});
|
|
|
|
test('tax belongs to invoice', function () {
|
|
$tax = Tax::factory()->forInvoice()->create();
|
|
|
|
$this->assertTrue($tax->invoice()->exists());
|
|
});
|
|
|
|
test('tax belongs to recurring invoice', function () {
|
|
$tax = Tax::factory()->forRecurringInvoice()->create();
|
|
|
|
$this->assertTrue($tax->recurringInvoice()->exists());
|
|
});
|
|
|
|
test('tax belongs to estimate', function () {
|
|
$tax = Tax::factory()->forEstimate()->create();
|
|
|
|
$this->assertTrue($tax->estimate()->exists());
|
|
});
|
|
|
|
test('tax belongs to invoice item', function () {
|
|
$tax = Tax::factory()->for(InvoiceItem::factory()->state([
|
|
'invoice_id' => Invoice::factory(),
|
|
]))->create();
|
|
|
|
$this->assertTrue($tax->invoiceItem()->exists());
|
|
});
|
|
|
|
test('tax belongs to estimate item', function () {
|
|
$tax = Tax::factory()->for(EstimateItem::factory()->state([
|
|
'estimate_id' => Estimate::factory(),
|
|
]))->create();
|
|
|
|
$this->assertTrue($tax->estimateItem()->exists());
|
|
});
|
|
|
|
test('tax belongs to item', function () {
|
|
$tax = Tax::factory()->forItem()->create();
|
|
|
|
$this->assertTrue($tax->item()->exists());
|
|
});
|