Ejemplo n.º 1
0
 public function testObjectId()
 {
     $hf = $this->getMockedHeaderFactory();
     $message = new Message($hf);
     $message2 = new Message($hf);
     $this->assertNotEmpty($message->getObjectId());
     $this->assertSame($message->getObjectId(), $message->getObjectId());
     $this->assertSame($message2->getObjectId(), $message2->getObjectId());
     $this->assertNotSame($message->getObjectId(), $message2->getObjectId());
 }
 /**
  * Creates a part stream handle for the start and end position of the
  * message stream, and attaches it to the passed MimePart.
  * 
  * @param MimePart $part
  * @param Message $message
  * @param int $start
  * @param int $end
  */
 public function attachPartStreamHandle(MimePart $part, Message $message, $start, $end)
 {
     $id = $message->getObjectId();
     if (empty($this->registeredHandles[$id])) {
         return null;
     }
     $handle = fopen('mmp-mime-message://' . $id . '?start=' . $start . '&end=' . $end, 'r');
     $this->attachEncodingFilterToStream($part, $handle);
     $this->attachCharsetFilterToStream($part, $handle);
     $part->attachContentResourceHandle($handle);
 }