示例#1
0
 /**
  * Clears a custom header from this instance
  *
  * @param String $header The header to remove
  * @return \r8\Mail Returns a self reference
  */
 public function removeCustomHeader($header)
 {
     $header = \r8\Transform\MIME::stripHeaderName($header);
     if (\r8\isEmpty($header)) {
         throw new \r8\Exception\Argument(0, 'Header Name', 'Must not be empty');
     }
     if (isset($this->headers[$header])) {
         unset($this->headers[$header]);
     }
     return $this;
 }
示例#2
0
 public function testStripHeaderName()
 {
     $chars = implode("", array_map('chr', range(1, 255)));
     $this->assertSame('!"#$%&\'()*+,-./0123456789;<=>?@ABCDEFGHIJKLMNOP' . 'QRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~', \r8\Transform\MIME::stripHeaderName($chars));
 }