diff --git a/src/SilverStripe/BehatExtension/Utility/TestMailer.php b/src/SilverStripe/BehatExtension/Utility/TestMailer.php index 7b3a4e1..dfbb2f0 100644 --- a/src/SilverStripe/BehatExtension/Utility/TestMailer.php +++ b/src/SilverStripe/BehatExtension/Utility/TestMailer.php @@ -2,7 +2,7 @@ namespace SilverStripe\BehatExtension\Utility; -use SilverStripe\Control\Email\Mailer; +use SilverStripe\Dev\TestMailer as BaseTestMailer; use SilverStripe\Core\Injector\Injector; use TestSessionEnvironment; @@ -11,7 +11,7 @@ use TestSessionEnvironment; * but saves emails in {@link TestSessionEnvironment} * to share the state between PHP calls (CLI vs. browser). */ -class TestMailer extends Mailer +class TestMailer extends BaseTestMailer { /** @@ -24,55 +24,6 @@ class TestMailer extends Mailer $this->testSessionEnvironment = Injector::inst()->get('TestSessionEnvironment'); } - /** - * Send a plain-text email. - * TestMailer will merely record that the email was asked to be sent, without sending anything. - */ - public function sendPlain($to, $from, $subject, $plainContent, $attachedFiles = false, $customHeaders = false) - { - $this->saveEmail(array( - 'Type' => 'plain', - 'To' => $to, - 'From' => $from, - 'Subject' => $subject, - 'Content' => $plainContent, - 'PlainContent' => $plainContent, - 'AttachedFiles' => $attachedFiles, - 'CustomHeaders' => $customHeaders, - )); - - return true; - } - - /** - * Send a multi-part HTML email - * TestMailer will merely record that the email was asked to be sent, without sending anything. - */ - public function sendHTML( - $to, - $from, - $subject, - $htmlContent, - $attachedFiles = false, - $customHeaders = false, - $plainContent = false, - $inlineImages = false - ) { - - $this->saveEmail(array( - 'Type' => 'html', - 'To' => $to, - 'From' => $from, - 'Subject' => $subject, - 'Content' => $htmlContent, - 'PlainContent' => $plainContent, - 'AttachedFiles' => $attachedFiles, - 'CustomHeaders' => $customHeaders, - )); - - return true; - } - /** * Clear the log of emails sent */