Example #1
0
 public function testCastingToStringReturnsAllMultiHeaderValues()
 {
     $headers = new Headers();
     $received1 = Header\Received::fromString("Received: from framework (localhost [127.0.0.1])\r\nby framework (Postfix) with ESMTP id BBBBBBBBBBB\r\nfor <zend@framework>; Mon, 21 Nov 2011 12:50:27 -0600 (CST)");
     $received2 = Header\Received::fromString("Received: from framework (localhost [127.0.0.1])\r\nby framework (Postfix) with ESMTP id AAAAAAAAAAA\r\nfor <zend@framework>; Mon, 21 Nov 2011 12:50:29 -0600 (CST)");
     $headers->addHeader($received1);
     $headers->addHeader($received2);
     $string = $headers->toString();
     $expected = array('Received: ' . $received1->getFieldValue(), 'Received: ' . $received2->getFieldValue());
     $expected = implode("\r\n", $expected) . "\r\n";
     $this->assertEquals($expected, $string);
 }
Example #2
0
 public function testFromStringCreatesValidReceivedHeader()
 {
     $receivedHeader = Header\Received::fromString('Received: xxx');
     $this->assertInstanceOf('Zend\\Mail\\Header\\HeaderInterface', $receivedHeader);
     $this->assertInstanceOf('Zend\\Mail\\Header\\Received', $receivedHeader);
 }