You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.
Case: a test on a controller that sends a mail, then redirects
Expected: if I count mail sent, I get 1
Bug: the mail is counted twice, once per client navigation, and I get 2
class ControllerTest extends ParaunitFunctionalTestCase
{
public function testMail()
{
$client = static::getAuthorizedClient();
$client->enableProfiler();
$client->followRedirects();
$crawler = $client->request('GET','notification/1');
$button = $crawler->selectButton('notification[sendButton]');
$form = $button->form();
$client->submit($form);
$mailCollector = $client->getProfile()->getCollector('swiftmailer');
// Redirect followed!!
$this->assertEquals(200, $client->getResponse()->getStatusCode());
// this fails!
$this->assertEquals(1, $mailCollector->getMessageCount());
}
}
For now, a possible workaround could be not following the redirect, checking the mail count before following the redirect o rebooting the kernel with the client. But this needs to be fixed.
The text was updated successfully, but these errors were encountered:
Case: a test on a controller that sends a mail, then redirects
Expected: if I count mail sent, I get 1
Bug: the mail is counted twice, once per client navigation, and I get 2
For now, a possible workaround could be not following the redirect, checking the mail count before following the redirect o rebooting the kernel with the client. But this needs to be fixed.
The text was updated successfully, but these errors were encountered: