/**
  * Test adding to spool/queueing message
  * @expectedException \Swift_IoException
  */
 public function testQueueMessageException()
 {
     $message = $this->getMock('\\Swift_Mime_Message');
     $this->em->expects($this->once())->method('persist')->with($this->isInstanceOf($this->className));
     $this->em->expects($this->once())->method('flush')->will($this->throwException(new \Exception('problem')));
     $this->spool->setFlushOnQueue(true);
     $this->spool->queueMessage($message);
 }