use PHPUnit\Framework\TestCase;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Message;
use Symfony\Component\Mime\MessageConverter;
use Symfony\Component\Mime\Part\DataPart;
class MessageConverterTest extends TestCase
{ public function testToEmail() { $file =
file_get_contents(__DIR__.'/Fixtures/mimetypes/test.gif'
);
$email =
(new Email())->
from('fabien@symfony.com'
)->
to('you@example.com'
);
$this->
assertSame($email, MessageConverter::
toEmail($email));
$this->
assertConversion((clone $email)->
text('text content'
));
$this->
assertConversion((clone $email)->
html('HTML content <img src="cid:test.jpg" />'
));
$this->
assertConversion((clone $email) ->
text('text content'
) ->
html('HTML content <img src="cid:test.jpg" />'
) );
$this->
assertConversion((clone $email) ->
text('text content'
) ->
html('HTML content <img src="cid:test.jpg" />'
)