From 17f0c8d3399c822de037623d074d32fa39aa0e7d Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 29 Aug 2024 15:31:36 +1200 Subject: [PATCH] API Update config to match changes in framework --- src/Context/EmailContext.php | 3 ++- src/Utility/TestMailer.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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;