/** * @param \Zend\Mail\Header\HeaderInterface $header */ public function it_should_provide_headers($header) { $header->getFieldName()->willReturn('Reply-To'); $header->getFieldValue(false)->willReturn('*****@*****.**'); $this->addHeader($header); $this->addHeaders(['Content-Type' => 'text/html']); $result = $this->getHeaders()->toArray(); $result['Reply-To']->shouldBe('*****@*****.**'); $result['Content-Type']->shouldBe('text/html'); }
/** * Add a Header\Interface to this container, for raw values see {@link addHeaderLine()} and {@link addHeaders()} * * @param Header\HeaderInterface $header * @return Headers */ public function addHeader(Header\HeaderInterface $header) { $key = $this->normalizeFieldName($header->getFieldName()); $this->headersKeys[] = $key; $this->headers[] = $header; if ($this->getEncoding() !== 'ASCII') { $header->setEncoding($this->getEncoding()); } return $this; }