diff --git a/src/Context/EmailContext.php b/src/Context/EmailContext.php index e16a13df..9b028cc3 100644 --- a/src/Context/EmailContext.php +++ b/src/Context/EmailContext.php @@ -10,7 +10,7 @@ use SilverStripe\BehatExtension\Utility\TestMailer; use SilverStripe\Core\Injector\Injector; use Symfony\Component\DomCrawler\Crawler; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mailer\Transport\NullTransport; @@ -50,6 +50,7 @@ public function before(BeforeScenarioScope $event) { // Also set through the 'supportbehat' extension // to ensure its available both in CLI execution and the tested browser session + /** @var EventDispatcherInterface $dispatcher */ $dispatcher = Injector::inst()->get(EventDispatcherInterface::class . '.mailer'); $transport = new NullTransport($dispatcher); $this->mailer = new TestMailer($transport, $dispatcher); diff --git a/src/Utility/TestMailer.php b/src/Utility/TestMailer.php index 8b8d7a2e..6d684508 100644 --- a/src/Utility/TestMailer.php +++ b/src/Utility/TestMailer.php @@ -4,7 +4,7 @@ use InvalidArgumentException; use SilverStripe\Control\Email\Email; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use SilverStripe\Dev\TestMailer as BaseTestMailer; use SilverStripe\TestSession\TestSessionEnvironment; use Symfony\Component\Mailer\Envelope;