/**
  * Tests setting the name and body using the Notification class Constructor.
  */
 public function testConstructor()
 {
     // Create a new Notification using the Constructor to set the note name and body
     $note = new Notification('TestNote', 5, 'TestNoteType');
     // test assertions
     $this->assertTrue($note->getName() == 'TestNote', "Expecting note.getName() == 'TestNote'");
     $this->assertTrue($note->getBody() == 5, "Expecting note->getBody() as Number == 5");
     $this->assertTrue($note->getType() == 'TestNoteType', "Expecting note->getType() == 'TestNoteType'");
 }
Пример #2
0
 private static function getType(\Notification $n)
 {
     switch ($n->getType()) {
         case NotifyUI::SUCCESS:
             return 'SUCCESS';
         case NotifyUI::ERROR:
             return 'ERROR';
         case NotifyUI::WARNING:
             return 'WARNING';
         default:
             return 'UNKNOWN';
     }
 }
 private static function getType(Notification $n)
 {
     switch ($n->getType()) {
         case INTERN_SUCCESS:
             return 'SUCCESS';
         case INTERN_ERROR:
             return 'ERROR';
         case INTERN_WARNING:
             return 'WARNING';
         default:
             return 'UNKNOWN';
     }
 }
Пример #4
0
 protected function resolveType(\Notification $notification)
 {
     switch ($notification->getType()) {
         case NotificationView::ERROR:
             return 'ERROR';
         case NotificationView::WARNING:
             return 'WARNING';
         case NotificationView::SUCCESS:
             return 'SUCCESS';
         default:
             return 'UNKNOWN';
     }
 }
Пример #5
0
 protected function resolveType(Notification $notification)
 {
     switch ($notification->getType()) {
         case FAX_NOTIFICATION_ERROR:
             return 'ERROR';
         case FAX_NOTIFICATION_WARNING:
             return 'WARNING';
         case FAX_NOTIFICATION_SUCCESS:
             return 'SUCCESS';
         default:
             return 'UNKNOWN';
     }
 }
Пример #6
0
 public function getNotificationUrl(Notification $notification)
 {
     return $this->container->get('router')->generate('notification_show', array('slug' => $notification->getProject()->getSlug(), $notification->getType() => true));
 }
Пример #7
0
 /**
  * Sets the congifuration settings of the given default notification.
  *
  * @param \Codenest\Ahem\Notification $notification
  *
  * @return \Codenest\Ahem\Notification
  */
 protected function configureDefault(Notification $notification)
 {
     $settings = $this->config->getSettings($notification->getType());
     return $notification->configure($settings);
 }