Skip to content

Commit

Permalink
Add test for 422
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jul 24, 2024
1 parent fb1f626 commit ba04c20
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Tests/Functional/Mail/HelperTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,22 @@ protected function doSendForm(Form $form): void
$formSelector = \sprintf('form[name=%s]', $formName);
$this->assertEquals(1, $crawler->filter($formSelector)->count());

$formElm = $crawler->filter($formSelector)->first()->form([
$formName . '[email]' => '',
$formName . '[email1]' => '',
]);

$this->client->enableProfiler();
$crawler = $this->client->submit($formElm);
$this->assertResponseStatusCodeSame(422);

$formElm = $crawler->filter($formSelector)->first()->form([
$formName . '[email]' => '[email protected]',
$formName . '[email1]' => '[email protected]',
]);

$this->client->enableProfiler();
$this->client->submit($formElm);
$this->assertResponseStatusCodeSame(302);
$this->assertResponseRedirects('?send=true');
}
}

0 comments on commit ba04c20

Please sign in to comment.