make(['first_name' => 'Erika', 'last_name' => 'Mustermann']); expect($contact->displayName())->toBe('Erika Mustermann'); }); test('displayName trims a missing part', function () { $contact = Contact::factory()->make(['first_name' => null, 'last_name' => 'Mustermann']); expect($contact->displayName())->toBe('Mustermann'); }); test('displayName falls back when both names are empty', function () { $contact = Contact::factory()->make(['first_name' => null, 'last_name' => null]); expect($contact->displayName())->toBe(__('Kontakt ohne Name')); });