@@ -48,50 +48,41 @@ public function setUp() {
4848 );
4949 }
5050
51- public function testGetMailInstance () {
52- $ this ->assertEquals (\Swift_MailTransport::newInstance (), self ::invokePrivate ($ this ->mailer , 'getMailinstance ' ));
53- }
54-
5551 public function testGetSendMailInstanceSendMail () {
5652 $ this ->config
5753 ->expects ($ this ->once ())
5854 ->method ('getSystemValue ' )
59- ->with ('mail_smtpmode ' , 'php ' )
55+ ->with ('mail_smtpmode ' , 'smtp ' )
6056 ->will ($ this ->returnValue ('sendmail ' ));
6157
62- $ this ->assertEquals (\Swift_SendmailTransport:: newInstance ('/usr/sbin/sendmail -bs ' ), self ::invokePrivate ($ this ->mailer , 'getSendMailInstance ' ));
58+ $ this ->assertEquals (new \Swift_SendmailTransport ('/usr/sbin/sendmail -bs ' ), self ::invokePrivate ($ this ->mailer , 'getSendMailInstance ' ));
6359 }
6460
6561 public function testGetSendMailInstanceSendMailQmail () {
6662 $ this ->config
6763 ->expects ($ this ->once ())
6864 ->method ('getSystemValue ' )
69- ->with ('mail_smtpmode ' , 'php ' )
65+ ->with ('mail_smtpmode ' , 'smtp ' )
7066 ->will ($ this ->returnValue ('qmail ' ));
7167
72- $ this ->assertEquals (\Swift_SendmailTransport:: newInstance ('/var/qmail/bin/sendmail -bs ' ), self ::invokePrivate ($ this ->mailer , 'getSendMailInstance ' ));
68+ $ this ->assertEquals (new \Swift_SendmailTransport ('/var/qmail/bin/sendmail -bs ' ), self ::invokePrivate ($ this ->mailer , 'getSendMailInstance ' ));
7369 }
7470
7571 public function testGetInstanceDefault () {
76- $ this ->assertInstanceOf ('\Swift_MailTransport ' , self ::invokePrivate ($ this ->mailer , 'getInstance ' ));
77- }
78-
79- public function testGetInstancePhp () {
80- $ this ->config
81- ->expects ($ this ->any ())
82- ->method ('getSystemValue ' )
83- ->will ($ this ->returnValue ('php ' ));
84-
85- $ this ->assertInstanceOf ('\Swift_MailTransport ' , self ::invokePrivate ($ this ->mailer , 'getInstance ' ));
72+ $ mailer = self ::invokePrivate ($ this ->mailer , 'getInstance ' );
73+ $ this ->assertInstanceOf (\Swift_Mailer::class, $ mailer );
74+ $ this ->assertInstanceOf (\Swift_SmtpTransport::class, $ mailer ->getTransport ());
8675 }
8776
8877 public function testGetInstanceSendmail () {
8978 $ this ->config
90- ->expects ($ this ->any ())
9179 ->method ('getSystemValue ' )
92- ->will ($ this ->returnValue ('sendmail ' ));
80+ ->with ('mail_smtpmode ' , 'smtp ' )
81+ ->willReturn ('sendmail ' );
9382
94- $ this ->assertInstanceOf ('\Swift_Mailer ' , self ::invokePrivate ($ this ->mailer , 'getInstance ' ));
83+ $ mailer = self ::invokePrivate ($ this ->mailer , 'getInstance ' );
84+ $ this ->assertInstanceOf (\Swift_Mailer::class, $ mailer );
85+ $ this ->assertInstanceOf (\Swift_SendmailTransport::class, $ mailer ->getTransport ());
9586 }
9687
9788 public function testCreateMessage () {
0 commit comments