diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Mail/MailerTest.php | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index 2dd4bca5190..d724cd630d3 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -48,50 +48,41 @@ class MailerTest extends TestCase { ); } - public function testGetMailInstance() { - $this->assertEquals(\Swift_MailTransport::newInstance(), self::invokePrivate($this->mailer, 'getMailinstance')); - } - public function testGetSendMailInstanceSendMail() { $this->config ->expects($this->once()) ->method('getSystemValue') - ->with('mail_smtpmode', 'php') + ->with('mail_smtpmode', 'smtp') ->will($this->returnValue('sendmail')); - $this->assertEquals(\Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs'), self::invokePrivate($this->mailer, 'getSendMailInstance')); + $this->assertEquals(new \Swift_SendmailTransport('/usr/sbin/sendmail -bs'), self::invokePrivate($this->mailer, 'getSendMailInstance')); } public function testGetSendMailInstanceSendMailQmail() { $this->config ->expects($this->once()) ->method('getSystemValue') - ->with('mail_smtpmode', 'php') + ->with('mail_smtpmode', 'smtp') ->will($this->returnValue('qmail')); - $this->assertEquals(\Swift_SendmailTransport::newInstance('/var/qmail/bin/sendmail -bs'), self::invokePrivate($this->mailer, 'getSendMailInstance')); + $this->assertEquals(new \Swift_SendmailTransport('/var/qmail/bin/sendmail -bs'), self::invokePrivate($this->mailer, 'getSendMailInstance')); } public function testGetInstanceDefault() { - $this->assertInstanceOf('\Swift_MailTransport', self::invokePrivate($this->mailer, 'getInstance')); - } - - public function testGetInstancePhp() { - $this->config - ->expects($this->any()) - ->method('getSystemValue') - ->will($this->returnValue('php')); - - $this->assertInstanceOf('\Swift_MailTransport', self::invokePrivate($this->mailer, 'getInstance')); + $mailer = self::invokePrivate($this->mailer, 'getInstance'); + $this->assertInstanceOf(\Swift_Mailer::class, $mailer); + $this->assertInstanceOf(\Swift_SmtpTransport::class, $mailer->getTransport()); } public function testGetInstanceSendmail() { $this->config - ->expects($this->any()) ->method('getSystemValue') - ->will($this->returnValue('sendmail')); + ->with('mail_smtpmode', 'smtp') + ->willReturn('sendmail'); - $this->assertInstanceOf('\Swift_Mailer', self::invokePrivate($this->mailer, 'getInstance')); + $mailer = self::invokePrivate($this->mailer, 'getInstance'); + $this->assertInstanceOf(\Swift_Mailer::class, $mailer); + $this->assertInstanceOf(\Swift_SendmailTransport::class, $mailer->getTransport()); } public function testCreateMessage() { |