/** * @param string $application The application name * @param Growler\notification $notification The notification to send */ public function send($application, $notification) { $message = new \Growler\Gntp\Request\Notify($application, $notification, $this->_password); $this->_connection->send($message->__toString()); $this->_connection->consume(); $this->_connection->disconnect(); }
public function testNotifyRequestWithNotificationCustomIcon() { $application = new \Growler\Application("Test application"); $n = new \Growler\Notification(new \Growler\NotificationType("TYPE1"), "Title", "Message", "http://foo"); $r = new \Growler\Gntp\Request\Notify($application, $n); $this->assertEquals("GNTP/1.0 NOTIFY NONE\r\n" . "X-Sender: Growler - PHP Growl notification library\r\n" . "Application-Name: " . $application->getName() . "\r\n" . "Notification-Name: " . $n->getType()->getName() . "\r\n" . "Notification-Title: " . $n->getTitle() . "\r\n" . "Notification-Text: " . $n->getMessage() . "\r\n" . "Notification-Icon: " . $n->getIcon() . "\r\n" . "\r\n", $r->__toString()); }