Created
July 17, 2014 17:42
-
-
Save DragonBe/a2f16a106fb29c9dfba7 to your computer and use it in GitHub Desktop.
Testing if mail headers are properly removed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace BMytest; | |
class ZendMailTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testRemovingHeadersFromMultipleMailObjects() | |
{ | |
$mail1 = new \Zend_Mail(); | |
$mail1->addHeader('foo', 'bar'); | |
$mail1->addHeader('x-mfo-mailid', uniqid()); | |
$mail2 = clone $mail1; | |
$mail2->addHeader('bar', 'baz', true); | |
$mail3 = clone $mail2; | |
$mail3->addHeader('baz', 'foobar', true); | |
$mailList = array ($mail1, $mail2, $mail3); | |
foreach ($mailList as $mail) { | |
$mail->clearHeader('x-mfo-mailid'); | |
$this->assertArrayNotHasKey('x-mfo-mailid', $mail->getHeaders()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment