Fix tests

This commit is contained in:
philipp lang 2024-03-15 01:59:22 +01:00
parent 9144ae1028
commit 8d2f8ec03d
3 changed files with 15 additions and 4 deletions

View File

@ -56,7 +56,7 @@ class ConfirmRegistrationMail extends Mailable
/**
* Get the attachments for the message.
*
* @return array
* @return array<int, mixed>
*/
public function attachments()
{

View File

@ -61,7 +61,7 @@ class FormFactory extends Factory
}
/**
* @param array<int, FormtemplateFieldRequest> $sections
* @param array<int, FormtemplateFieldRequest> $fields
*/
public function fields(array $fields): self
{

View File

@ -16,8 +16,19 @@ class FormRegisterMailTest extends FormTestCase
public function testItShowsFormContent(): void
{
$this->login()->loginNami()->withoutExceptionHandling();
$participant = Participant::factory()
->for(Form::factory()->mailTop('mail top')->mailBottom('mail bottom'))->create();
$participant = Participant::factory()->for(
Form::factory()->sections([
FormtemplateSectionRequest::new()->name('Persönliches')->fields([
$this->textField('vorname')->name('Vorname')->specialType(SpecialType::FIRSTNAME),
$this->textField('nachname')->specialType(SpecialType::LASTNAME),
])
])
->mailTop('mail top')->mailBottom('mail bottom')
)
->data(['vorname' => 'Max', 'nachname' => 'Muster'])
->create();
$mail = new ConfirmRegistrationMail($participant);
$mail->assertSeeInText('mail top');