/**
  * @param string $exceptionMessage
  * @param array  $templates
  * @dataProvider templateProvider
  */
 public function testGetTemplateFromRepository($exceptionMessage, $templates)
 {
     $this->setExpectedException('Oro\\Bundle\\ReminderBundle\\Exception\\InvalidArgumentException', $exceptionMessage);
     $repository = $this->getMock('Doctrine\\Common\\Persistence\\ObjectRepository');
     $repository->expects($this->any())->method('find')->will($this->returnValue(new CalendarEvent()));
     $repository->expects($this->any())->method('findBy')->will($this->returnValue($templates));
     $this->em->expects($this->any())->method('getRepository')->will($this->returnValue($repository));
     $this->notification->setTemplateName('template_test');
     $this->notification->getTemplate();
 }
Example #2
0
 /**
  * @param CalendarEvent     $calendarEvent
  * @param array             $emails
  * @param string            $templateName
  */
 protected function addEmailNotification(CalendarEvent $calendarEvent, $emails, $templateName)
 {
     $emailNotification = new EmailNotification($this->em);
     $emailNotification->setEmails($emails);
     $emailNotification->setCalendarEvent($calendarEvent);
     $emailNotification->setTemplateName($templateName);
     $this->emailNotifications[] = $emailNotification;
 }