Skip to content

Commit

Permalink
Add test for content-id header formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Oct 14, 2019
1 parent 0dccabd commit b8c44fc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/PHPMailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,23 @@ public function testEmbeddedImage()

$this->buildBody();
$this->assertTrue($this->Mail->send(), $this->Mail->ErrorInfo);
$this->Mail->clearAttachments();
$this->Mail->msgHTML('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>E-Mail Inline Image Test</title>
</head>
<body>
<p><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="></p>
</body>
</html>');
$this->Mail->preSend();
$this->assertContains(
'Content-ID: <[email protected]>',
$this->Mail->getSentMIMEMessage(),
'Embedded image header encoding incorrect.'
);
//For code coverage
$this->Mail->addEmbeddedImage('thisfiledoesntexist', 'xyz'); //Non-existent file
$this->Mail->addEmbeddedImage(__FILE__, '123'); //Missing name
Expand Down

0 comments on commit b8c44fc

Please sign in to comment.