This commit is contained in:
Philipp Lang 2023-12-17 02:03:39 +01:00
parent bf8f6c87a8
commit 703c74a9f4
3 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ class InvoiceDestroyActionTest extends TestCase
public function testItDestroysInvoice(): void
{
$this->login()->loginNami()->withoutExceptionHandling();
$invoice = Invoice::factory()->has(InvoicePosition::factory(), 'positions')->create();
$invoice = Invoice::factory()->has(InvoicePosition::factory()->withMember(), 'positions')->create();
$this->delete(route('invoice.destroy', ['invoice' => $invoice]))->assertOk();
$this->assertDatabaseCount('invoices', 0);

View File

@ -21,7 +21,7 @@ class InvoiceIndexActionTest extends TestCase
$member = Member::factory()->defaults()->create(['firstname' => 'Aaaa', 'lastname' => 'Aaab']);
$invoice = Invoice::factory()
->has(InvoicePosition::factory()->price(1100)->for($member)->state(['description' => 'lala']), 'positions')
->has(InvoicePosition::factory()->price(2200), 'positions')
->has(InvoicePosition::factory()->price(2200)->withMember(), 'positions')
->to(ReceiverRequestFactory::new()->name('Familie Blabla'))
->sentAt(now()->subDay())
->via(BillKind::POST)

View File

@ -68,7 +68,7 @@ class InvoiceUpdateActionTest extends TestCase
public function testItUpdatesAPosition(): void
{
$this->login()->loginNami()->withoutExceptionHandling();
$invoice = Invoice::factory()->has(InvoicePosition::factory(), 'positions')->create();
$invoice = Invoice::factory()->has(InvoicePosition::factory()->withMember(), 'positions')->create();
$this->patchJson(
route('invoice.update', ['invoice' => $invoice]),
@ -87,7 +87,7 @@ class InvoiceUpdateActionTest extends TestCase
public function testItDeletesAPosition(): void
{
$this->login()->loginNami()->withoutExceptionHandling();
$invoice = Invoice::factory()->has(InvoicePosition::factory(), 'positions')->create();
$invoice = Invoice::factory()->has(InvoicePosition::factory()->withMember(), 'positions')->create();
$this->patchJson(
route('invoice.update', ['invoice' => $invoice]),