Fix typo. getMessage() in the mobile listener should delegate to
authorGunnar Wrobel <p@rdus.de>
Tue, 27 Oct 2009 18:35:58 +0000 (19:35 +0100)
committerGunnar Wrobel <p@rdus.de>
Tue, 27 Oct 2009 18:35:58 +0000 (19:35 +0100)
getMessage() instead of notify() in the status listener if no mobile
handler is set.

framework/Notification/lib/Horde/Notification/Listener/Mobile.php
framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php

index 0684e75..575ae6b 100644 (file)
@@ -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);
index 7304948..2417d62 100644 (file)
@@ -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));
+    }
+
 }