From: Gunnar Wrobel
Date: Tue, 27 Oct 2009 18:35:58 +0000 (+0100) Subject: Fix typo. getMessage() in the mobile listener should delegate to X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7ee14724b0dcdb39d2d8b66d2b57942f88ab251d;p=horde.git Fix typo. getMessage() in the mobile listener should delegate to getMessage() instead of notify() in the status listener if no mobile handler is set. --- diff --git a/framework/Notification/lib/Horde/Notification/Listener/Mobile.php b/framework/Notification/lib/Horde/Notification/Listener/Mobile.php index 0684e752b..575ae6b59 100644 --- a/framework/Notification/lib/Horde/Notification/Listener/Mobile.php +++ b/framework/Notification/lib/Horde/Notification/Listener/Mobile.php @@ -77,7 +77,7 @@ class Horde_Notification_Listener_Mobile extends Horde_Notification_Listener_Sta { if (!$this->_mobile) { $p = new Horde_Notification_Listener_Status(); - return $p->notify($messageStack, $options); + return $p->getMessage($message, $options); } $event = $this->getEvent($message); diff --git a/framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php b/framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php index 730494824..2417d62f5 100644 --- a/framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php +++ b/framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php @@ -117,4 +117,19 @@ class Horde_Notification_Class_Notification_Listener_MobileTest extends PHPUnit_ ); $listener->notify($messages); } + + public function testMethodGetmessageHasSameOutputAsTheStatusListenerIfNoMobileObjectWasSet() + { + $listener = new Horde_Notification_Listener_Mobile(); + $event = new Horde_Notification_Event('test'); + $flags = array('content.raw' => true); + $message = array( + 'class' => 'Horde_Notification_Event', + 'event' => serialize($event), + 'type' => 'horde.message', + 'flags' => serialize($flags) + ); + $listener->getMessage($message, array('data' => true)); + } + }