/**
  * @test
  */
 public function thatMessagesAreFetched()
 {
     $zendMailMessage = new ZendMailMessage();
     $zendMailMessage->setHeaders($this->headers());
     $this->converter->expects($this->once())->method('fromRawMessage')->with($this->equalTo(self::DUMMY_RAW_MESSAGE))->will($this->returnValue($zendMailMessage));
     $messages = $this->messageProvider->fetchMessagesToProcess();
     $this->assertNotEmpty($messages);
     $this->assertContainsOnlyInstancesOf('\\Diamante\\EmailProcessingBundle\\Model\\Message', $messages);
 }
 /**
  * @return ZendMailMessage
  */
 public function fromRawMessage($rawMessage)
 {
     return ZendMailMessage::fromString($rawMessage);
 }