public function testSetReminderData() { $expectedSubject = 'subject'; $expectedExpireAt = new \DateTime(); $expectedRecipient = $this->getMock('Oro\\Bundle\\UserBundle\\Entity\\User'); $reminderData = $this->getMock('Oro\\Bundle\\ReminderBundle\\Model\\ReminderDataInterface'); $reminderData->expects($this->once())->method('getSubject')->will($this->returnValue($expectedSubject)); $reminderData->expects($this->once())->method('getExpireAt')->will($this->returnValue($expectedExpireAt)); $reminderData->expects($this->once())->method('getRecipient')->will($this->returnValue($expectedRecipient)); $this->entity->setReminderData($reminderData); $this->assertEquals($expectedSubject, $this->entity->getSubject()); $this->assertEquals($expectedExpireAt, $this->entity->getExpireAt()); $this->assertEquals($expectedRecipient, $this->entity->getRecipient()); }
/** * Sync reminder with entity data * * @param Reminder $reminder * @param ReminderDataInterface $reminderData * @param string $entityClass * @param mixed $entityId */ protected function syncEntityReminder(Reminder $reminder, ReminderDataInterface $reminderData, $entityClass, $entityId) { $reminder->setReminderData($reminderData); $reminder->setRelatedEntityClassName($entityClass); $reminder->setRelatedEntityId($entityId); }