Browse Source

Creating transport at 'yii\swiftmailer\Mailer' fixed to track possible "__call".

tags/2.0.0-beta
Paul Klimov 11 years ago
parent
commit
5a584c0bda
  1. 2
      extensions/swiftmailer/Mailer.php
  2. 2
      tests/unit/extensions/swiftmailer/MailerTest.php

2
extensions/swiftmailer/Mailer.php

@ -145,7 +145,7 @@ class Mailer extends BaseMailer
$transport->$name = $value; $transport->$name = $value;
} else { } else {
$setter = 'set' . $name; $setter = 'set' . $name;
if (method_exists($transport, $setter)) { if (method_exists($transport, $setter) || method_exists($transport, '__call')) {
$transport->$setter($value); $transport->$setter($value);
} else { } else {
throw new InvalidConfigException('Setting unknown property: ' . get_class($transport) . '::' . $name); throw new InvalidConfigException('Setting unknown property: ' . get_class($transport) . '::' . $name);

2
tests/unit/extensions/swiftmailer/MailerTest.php

@ -53,6 +53,8 @@ class MailerTest extends VendorTestCase
$transportConfig = [ $transportConfig = [
'class' => 'Swift_SmtpTransport', 'class' => 'Swift_SmtpTransport',
'host' => 'localhost', 'host' => 'localhost',
'username' => 'username',
'password' => 'password',
]; ];
$mailer->setTransport($transportConfig); $mailer->setTransport($transportConfig);
$transport = $mailer->getTransport(); $transport = $mailer->getTransport();

Loading…
Cancel
Save