Browse 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 12 năm trước cách đây
mục cha
commit
9d8b575cde
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  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
      */