/** * @dataProvider dataSetParsedSubject * @param string $subject */ public function testSetParsedSubject($subject) { $this->assertSame('', $this->notification->getParsedSubject()); $this->assertSame($this->notification, $this->notification->setParsedSubject($subject)); $this->assertSame($subject, $this->notification->getParsedSubject()); }
/** * @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; }