Added custom header getter
This commit is contained in:
parent
095193b5ed
commit
47fd54d04d
|
|
@ -1,5 +1,6 @@
|
|||
# ChangeLog
|
||||
|
||||
* Add custom header getter
|
||||
* Use `application/javascript` for .js attachments
|
||||
* Improve RFC2821 compliance for timelimits, especially for end-of-data
|
||||
* Add Azerbaijani translations (Thanks to @mirjalal)
|
||||
|
|
|
|||
|
|
@ -2952,6 +2952,16 @@ class PHPMailer
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all custom headers
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCustomHeaders()
|
||||
{
|
||||
return $this->CustomHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a message from an HTML string.
|
||||
* Automatically makes modifications for inline images and backgrounds
|
||||
|
|
|
|||
|
|
@ -1680,6 +1680,33 @@ EOT;
|
|||
'SMTP connect with options failed'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the Custom header getter
|
||||
*/
|
||||
public function testCustomHeaderGetter()
|
||||
{
|
||||
$this->Mail->addCustomHeader('foo', 'bar');
|
||||
$this->assertEquals(array(array('foo', 'bar')), $this->Mail->getCustomHeaders());
|
||||
|
||||
$this->Mail->addCustomHeader('foo', 'baz');
|
||||
$this->assertEquals(array(
|
||||
array('foo', 'bar'),
|
||||
array('foo', 'baz')
|
||||
), $this->Mail->getCustomHeaders());
|
||||
|
||||
$this->Mail->clearCustomHeaders();
|
||||
$this->assertEmpty($this->Mail->getCustomHeaders());
|
||||
|
||||
$this->Mail->addCustomHeader('yux');
|
||||
$this->assertEquals(array(array('yux')), $this->Mail->getCustomHeaders());
|
||||
|
||||
$this->Mail->addCustomHeader('Content-Type: application/json');
|
||||
$this->assertEquals(array(
|
||||
array('yux'),
|
||||
array('Content-Type', ' application/json')
|
||||
), $this->Mail->getCustomHeaders());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue