Parcourir la source

Merge pull request #148 from siad007/patch-1

Add test for #52 - Zend_Mobile: GCM time_to_live is not send when set to 0
Frank Brückner il y a 12 ans
Parent
commit
9d8b575cde
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      tests/Zend/Mobile/Push/Message/GcmTest.php

+ 8 - 0
tests/Zend/Mobile/Push/Message/GcmTest.php

@@ -107,6 +107,14 @@ class Zend_Mobile_Push_Message_GcmTest extends PHPUnit_Framework_TestCase
         $this->assertEquals(10, $msg->getTtl());
     }
 
+    public function testTtlSendMessageOnZero()
+    {
+        $msg = new Zend_Mobile_Push_Message_Gcm();
+        $msg->setTtl(0);
+        $this->assertEquals(0, $msg->getTtl());
+        $this->assertEquals('{"time_to_live":0}', $msg->toJson());
+    }
+
     /**
      * @expectedException Zend_Mobile_Push_Message_Exception
      */