Commit 5a584c0b by Paul Klimov

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

parent a38c280a
...@@ -145,7 +145,7 @@ class Mailer extends BaseMailer ...@@ -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);
......
...@@ -53,6 +53,8 @@ class MailerTest extends VendorTestCase ...@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment