public function testMailResultInjection()
 {
     $this->mailEvent = new MailEvent(new MailServiceMock());
     $result = new MailResult();
     $this->assertSame($this->mailEvent, $this->mailEvent->setResult($result));
     $this->assertSame($result, $this->mailEvent->getResult());
 }
示例#2
0
 /**
  * Creates a new MailEvent object
  * @param ResultInterface $result
  * @param string $name
  * @return MailEvent
  */
 protected function createMailEvent($name = MailEvent::EVENT_MAIL_PRE_SEND, ResultInterface $result = null)
 {
     $event = new MailEvent($this, $name);
     if (isset($result)) {
         $event->setResult($result);
     }
     return $event;
 }