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
73a8e77c
Commit
73a8e77c
authored
Oct 25, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BaseMailer::defaultMessageConfig published as BaseMailer::messageConfig
parent
d33519e3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
21 deletions
+5
-21
BaseMailer.php
framework/yii/mail/BaseMailer.php
+1
-17
BaseMessage.php
framework/yii/mail/BaseMessage.php
+1
-1
BaseMailerTest.php
tests/unit/framework/mail/BaseMailerTest.php
+3
-3
No files found.
framework/yii/mail/BaseMailer.php
View file @
73a8e77c
...
@@ -48,7 +48,7 @@ abstract class BaseMailer extends Component
...
@@ -48,7 +48,7 @@ abstract class BaseMailer extends Component
* )
* )
* ~~~
* ~~~
*/
*/
p
rivate
$_defaultM
essageConfig
=
[];
p
ublic
$m
essageConfig
=
[];
/**
/**
* @param array|\yii\base\View $view view instance or its array configuration.
* @param array|\yii\base\View $view view instance or its array configuration.
...
@@ -97,22 +97,6 @@ abstract class BaseMailer extends Component
...
@@ -97,22 +97,6 @@ abstract class BaseMailer extends Component
}
}
/**
/**
* @param array $defaultMessageConfig default message config
*/
public
function
setDefaultMessageConfig
(
array
$defaultMessageConfig
)
{
$this
->
_defaultMessageConfig
=
$defaultMessageConfig
;
}
/**
* @return array default message config
*/
public
function
getDefaultMessageConfig
()
{
return
$this
->
_defaultMessageConfig
;
}
/**
* Creates view instance from given configuration.
* Creates view instance from given configuration.
* @param array $config view configuration.
* @param array $config view configuration.
* @return \yii\base\View view instance.
* @return \yii\base\View view instance.
...
...
framework/yii/mail/BaseMessage.php
View file @
73a8e77c
...
@@ -49,7 +49,7 @@ abstract class BaseMessage extends Object implements MessageInterface
...
@@ -49,7 +49,7 @@ abstract class BaseMessage extends Object implements MessageInterface
*/
*/
public
function
init
()
public
function
init
()
{
{
Yii
::
configure
(
$this
,
$this
->
getMailer
()
->
getDefaultMessageConfig
()
);
Yii
::
configure
(
$this
,
$this
->
getMailer
()
->
messageConfig
);
}
}
/**
/**
...
...
tests/unit/framework/mail/BaseMailerTest.php
View file @
73a8e77c
...
@@ -111,15 +111,15 @@ class BaseMailerTest extends TestCase
...
@@ -111,15 +111,15 @@ class BaseMailerTest extends TestCase
public
function
testDefaultMessageConfig
()
public
function
testDefaultMessageConfig
()
{
{
$
defaultM
essageConfig
=
array
(
$
m
essageConfig
=
array
(
'id'
=>
'test-id'
,
'id'
=>
'test-id'
,
'encoding'
=>
'test-encoding'
,
'encoding'
=>
'test-encoding'
,
);
);
Yii
::
$app
->
getComponent
(
'email'
)
->
setDefaultMessageConfig
(
$defaultMessageConfig
)
;
Yii
::
$app
->
getComponent
(
'email'
)
->
messageConfig
=
$messageConfig
;
$message
=
new
Message
();
$message
=
new
Message
();
foreach
(
$
defaultM
essageConfig
as
$name
=>
$value
)
{
foreach
(
$
m
essageConfig
as
$name
=>
$value
)
{
$this
->
assertEquals
(
$value
,
$message
->
$name
);
$this
->
assertEquals
(
$value
,
$message
->
$name
);
}
}
}
}
...
...
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