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
$this->fail('Emails can\'t be tested without Profiler');
474
+
if (!$profile = $this->getProfile()) {
475
+
$this->fail("Emails can't be tested without Profiler");
476
+
return;
478
477
}
479
-
switch ($this->config['mailer']) {
480
-
caseself::SWIFTMAILER:
481
-
if (!$profile->hasCollector('swiftmailer')) {
482
-
$this->fail(
483
-
"Emails can't be tested without SwiftMailer connector.\nIf you are using Symfony Mailer, set this in your `functional.suite.yml`: `mailer: 'symfony_mailer'`"
484
-
);
485
-
}
486
-
break;
487
-
caseself::SYMFONY_MAILER:
488
-
if (!$profile->hasCollector('mailer')) {
489
-
$this->fail(
490
-
'Emails can\'t be tested without Symfony Mailer connector.
491
-
If you are using SwiftMailer define mailer: "swiftmailer" in Symfony module config.'
492
-
);
493
-
}
494
-
break;
495
-
default:
496
-
$this->fail('Invalid mailer config. Allowed Options: "swiftmailer" or "mailer"');
478
+
479
+
$mailer = $this->config['mailer'];
480
+
if ($mailer === self::SYMFONY_MAILER) {
481
+
$mailer = 'mailer';
482
+
}
483
+
484
+
if (!$profile->hasCollector($mailer)) {
485
+
$this->fail(
486
+
"Emails can't be tested without Mailer service connector.
487
+
Set your mailer service in `functional.suite.yml`: `mailer: swiftmailer`
488
+
(Or `mailer: symfony_mailer` for Symfony Mailer)."
489
+
);
490
+
return;
497
491
}
498
492
499
493
if (!is_int($expectedCount) && !is_null($expectedCount)) {
500
494
$this->fail(sprintf(
501
495
'The required number of emails must be either an integer or null. "%s" was provided.',
502
496
print_r($expectedCount, true)
503
497
));
498
+
return;
504
499
}
505
500
506
-
if ($this->config['mailer'] === self::SWIFTMAILER) {
0 commit comments