login()->loginNami(); $invoice = Invoice::factory() ->to(ReceiverRequestFactory::new()->name('Familie Lala')) ->has(InvoicePosition::factory()->withMember()->description('Beitrag12'), 'positions') ->via(BillKind::EMAIL) ->create(); $this->get(route('invoice.pdf', ['invoice' => $invoice])) ->assertOk() ->assertPdfPageCount(1) ->assertPdfName('rechnung-fur-familie-lala.pdf'); Tex::assertCompiled(BillDocument::class, fn ($document) => $document->hasAllContent(['Beitrag12', 'Familie Lala'])); } }