defaults() ->postBillKind() ->state(['firstname' => 'Max1', 'lastname' => '::lastname::', 'address' => '::address::', 'zip' => '12345', 'location' => '::location::']) ->has(Payment::factory()->notPaid()->nr('nr1')) ->create(); Member::factory() ->defaults() ->postBillKind() ->state(['firstname' => 'Max2', 'lastname' => '::lastname::', 'address' => '::address::', 'zip' => '12345', 'location' => '::location::']) ->has(Payment::factory()->notPaid()->nr('nr2')) ->create(); $this->assertCount(2, $this->query(BillDocument::class)->getMembers()->first()); } /** * @param class-string $type */ private function query(string $type): InvoiceMemberQuery { return (new BillKindQuery(BillKind::POST))->type($type); } }