Exemplo n.º 1
0
 /**
  * @dataProvider dataSetParsedMessage
  * @param string $message
  */
 public function testSetParsedMessage($message)
 {
     $this->assertSame('', $this->notification->getParsedMessage());
     $this->assertSame($this->notification, $this->notification->setParsedMessage($message));
     $this->assertSame($message, $this->notification->getParsedMessage());
 }
 /**
  * @param int $notificationId
  * @param INotification $notification
  * @return array
  */
 protected function notificationToArray($notificationId, INotification $notification)
 {
     $data = ['notification_id' => $notificationId, 'app' => $notification->getApp(), 'user' => $notification->getUser(), 'timestamp' => $notification->getTimestamp(), 'object_type' => $notification->getObjectType(), 'object_id' => $notification->getObjectId(), 'subject' => $notification->getParsedSubject(), 'message' => $notification->getParsedMessage(), 'link' => $notification->getLink(), 'icon' => $notification->getIcon(), 'actions' => []];
     foreach ($notification->getParsedActions() as $action) {
         $data['actions'][] = $this->actionToArray($action);
     }
     return $data;
 }