Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
DraftEmail example
use
PHPUnit\Framework\TestCase;
use
Symfony\Component\Mime\DraftEmail;
use
Symfony\Component\Mime\Exception\LogicException;
/** * @author Kevin Bond <
[email protected]
> */
final
class
DraftEmailTest
extends
TestCase
{
public
function
testCanHaveJustBody
(
)
{
$email
=
(
new
DraftEmail
(
)
)
->
text
(
'some text'
)
->
toString
(
)
;
$this
->
assertStringContainsString
(
'some text',
$email
)
;
$this
->
assertStringContainsString
(
'MIME-Version: 1.0',
$email
)
;
$this
->
assertStringContainsString
(
'X-Unsent: 1',
$email
)
;
}
public
function
testBccIsRemoved
(
)
{
$email
=
(
new
DraftEmail
(
)
)
->
text
(
'some text'
)
->
bcc
(
'
[email protected]
'
)
->
toString
(
)
;
$this
->
assertStringNotContainsString
(
'
[email protected]
',
$email
)
;
}