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
b9fb97d6
Commit
b9fb97d6
authored
Nov 08, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Getters for 'yii\swiftmailer\Message' fixed.
parent
44bdb65d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
8 deletions
+44
-8
Mailer.php
extensions/swiftmailer/Mailer.php
+1
-1
Message.php
extensions/swiftmailer/Message.php
+7
-7
MessageTest.php
tests/unit/extensions/swiftmailer/MessageTest.php
+36
-0
No files found.
extensions/swiftmailer/Mailer.php
View file @
b9fb97d6
...
...
@@ -108,7 +108,7 @@ class Mailer extends BaseMailer
{
$address
=
$message
->
getTo
();
if
(
is_array
(
$address
))
{
$address
=
implode
(
', '
,
$address
);
$address
=
implode
(
', '
,
array_keys
(
$address
)
);
}
Yii
::
trace
(
'Sending email "'
.
$message
->
getSubject
()
.
'" to "'
.
$address
.
'"'
,
__METHOD__
);
return
$this
->
getSwiftMailer
()
->
send
(
$message
->
getSwiftMessage
())
>
0
;
...
...
extensions/swiftmailer/Message.php
View file @
b9fb97d6
...
...
@@ -44,7 +44,7 @@ class Message extends BaseMessage
*/
public
function
getCharset
()
{
$this
->
getSwiftMessage
()
->
getCharset
();
return
$this
->
getSwiftMessage
()
->
getCharset
();
}
/**
...
...
@@ -61,7 +61,7 @@ class Message extends BaseMessage
*/
public
function
getFrom
()
{
$this
->
getSwiftMessage
()
->
getFrom
();
return
$this
->
getSwiftMessage
()
->
getFrom
();
}
/**
...
...
@@ -78,7 +78,7 @@ class Message extends BaseMessage
*/
public
function
getReplyTo
()
{
$this
->
getSwiftMessage
()
->
getReplyTo
();
return
$this
->
getSwiftMessage
()
->
getReplyTo
();
}
/**
...
...
@@ -95,7 +95,7 @@ class Message extends BaseMessage
*/
public
function
getTo
()
{
$this
->
getSwiftMessage
()
->
getTo
();
return
$this
->
getSwiftMessage
()
->
getTo
();
}
/**
...
...
@@ -112,7 +112,7 @@ class Message extends BaseMessage
*/
public
function
getCc
()
{
$this
->
getSwiftMessage
()
->
getCc
();
return
$this
->
getSwiftMessage
()
->
getCc
();
}
/**
...
...
@@ -129,7 +129,7 @@ class Message extends BaseMessage
*/
public
function
getBcc
()
{
$this
->
getSwiftMessage
()
->
getBcc
();
return
$this
->
getSwiftMessage
()
->
getBcc
();
}
/**
...
...
@@ -146,7 +146,7 @@ class Message extends BaseMessage
*/
public
function
getSubject
()
{
$this
->
getSwiftMessage
()
->
getSubject
();
return
$this
->
getSwiftMessage
()
->
getSubject
();
}
/**
...
...
tests/unit/extensions/swiftmailer/MessageTest.php
View file @
b9fb97d6
...
...
@@ -115,6 +115,42 @@ class MessageTest extends VendorTestCase
/**
* @depends testGetSwiftMessage
*/
public
function
testSetGet
()
{
$message
=
new
Message
();
$charset
=
'utf-16'
;
$message
->
setCharset
(
$charset
);
$this
->
assertEquals
(
$charset
,
$message
->
getCharset
(),
'Unable to set charset!'
);
$subject
=
'Test Subject'
;
$message
->
setSubject
(
$subject
);
$this
->
assertEquals
(
$subject
,
$message
->
getSubject
(),
'Unable to set subject!'
);
$from
=
'from@somedomain.com'
;
$message
->
setFrom
(
$from
);
$this
->
assertContains
(
$from
,
array_keys
(
$message
->
getFrom
()),
'Unable to set from!'
);
$replyTo
=
'reply-to@somedomain.com'
;
$message
->
setReplyTo
(
$replyTo
);
$this
->
assertContains
(
$replyTo
,
array_keys
(
$message
->
getReplyTo
()),
'Unable to set replyTo!'
);
$to
=
'someuser@somedomain.com'
;
$message
->
setTo
(
$to
);
$this
->
assertContains
(
$to
,
array_keys
(
$message
->
getTo
()),
'Unable to set to!'
);
$cc
=
'ccuser@somedomain.com'
;
$message
->
setCc
(
$cc
);
$this
->
assertContains
(
$cc
,
array_keys
(
$message
->
getCc
()),
'Unable to set cc!'
);
$bcc
=
'bccuser@somedomain.com'
;
$message
->
setBcc
(
$bcc
);
$this
->
assertContains
(
$bcc
,
array_keys
(
$message
->
getBcc
()),
'Unable to set bcc!'
);
}
/**
* @depends testGetSwiftMessage
*/
public
function
testSetupHeaders
()
{
$charset
=
'utf-16'
;
...
...
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