Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
b20e5768
Commit
b20e5768
authored
Nov 22, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"yii\swiftmailer\Mailer::createSwiftObject()" simplified.
parent
704f9105
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Mailer.php
extensions/swiftmailer/Mailer.php
+1
-1
MailerTest.php
tests/unit/extensions/swiftmailer/MailerTest.php
+3
-1
No files found.
extensions/swiftmailer/Mailer.php
View file @
b20e5768
...
@@ -192,7 +192,7 @@ class Mailer extends BaseMailer
...
@@ -192,7 +192,7 @@ class Mailer extends BaseMailer
}
}
}
}
unset
(
$config
[
'constructArgs'
]);
unset
(
$config
[
'constructArgs'
]);
array_unshift
(
$args
,
[
'class'
=>
$className
]
);
array_unshift
(
$args
,
$className
);
$object
=
call_user_func_array
([
'Yii'
,
'createObject'
],
$args
);
$object
=
call_user_func_array
([
'Yii'
,
'createObject'
],
$args
);
}
else
{
}
else
{
$object
=
new
$className
;
$object
=
new
$className
;
...
...
tests/unit/extensions/swiftmailer/MailerTest.php
View file @
b20e5768
...
@@ -70,10 +70,11 @@ class MailerTest extends VendorTestCase
...
@@ -70,10 +70,11 @@ class MailerTest extends VendorTestCase
{
{
$mailer
=
new
Mailer
();
$mailer
=
new
Mailer
();
$class
=
'Swift_SmtpTransport'
;
$host
=
'some.test.host'
;
$host
=
'some.test.host'
;
$port
=
999
;
$port
=
999
;
$transportConfig
=
[
$transportConfig
=
[
'class'
=>
'Swift_SmtpTransport'
,
'class'
=>
$class
,
'constructArgs'
=>
[
'constructArgs'
=>
[
$host
,
$host
,
$port
,
$port
,
...
@@ -82,6 +83,7 @@ class MailerTest extends VendorTestCase
...
@@ -82,6 +83,7 @@ class MailerTest extends VendorTestCase
$mailer
->
setTransport
(
$transportConfig
);
$mailer
->
setTransport
(
$transportConfig
);
$transport
=
$mailer
->
getTransport
();
$transport
=
$mailer
->
getTransport
();
$this
->
assertTrue
(
is_object
(
$transport
),
'Unable to setup transport via config!'
);
$this
->
assertTrue
(
is_object
(
$transport
),
'Unable to setup transport via config!'
);
$this
->
assertEquals
(
$class
,
get_class
(
$transport
),
'Invalid transport class!'
);
$this
->
assertEquals
(
$host
,
$transport
->
getHost
(),
'Invalid transport host!'
);
$this
->
assertEquals
(
$host
,
$transport
->
getHost
(),
'Invalid transport host!'
);
$this
->
assertEquals
(
$port
,
$transport
->
getPort
(),
'Invalid transport host!'
);
$this
->
assertEquals
(
$port
,
$transport
->
getPort
(),
'Invalid transport host!'
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment