File tree Expand file tree Collapse file tree 3 files changed +48
-2
lines changed
main/php/Gomoob/Pushwoosh/Model/Notification
test/php/Gomoob/Pushwoosh/Model/Notification Expand file tree Collapse file tree 3 files changed +48
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ class Chrome implements \JsonSerializable
3535 * @var string
3636 */
3737 private $ title ;
38+
39+ /**
40+ * The image of the message.
41+ *
42+ * @var string
43+ */
44+ private $ image ;
3845
3946 /**
4047 * Utility function used to create a new Chrome instance.
@@ -75,6 +82,16 @@ public function getTitle()
7582 {
7683 return $ this ->title ;
7784 }
85+
86+ /**
87+ * Gets the image of the message.
88+ *
89+ * @var string The image of the message.
90+ */
91+ public function getImage ()
92+ {
93+ return $ this ->image ;
94+ }
7895
7996 /**
8097 * {@inheritdoc}
@@ -86,6 +103,7 @@ public function jsonSerialize()
86103 isset ($ this ->gcmTtl ) ? $ json ['chrome_gcm_ttl ' ] = $ this ->gcmTtl : false ;
87104 isset ($ this ->icon ) ? $ json ['chrome_icon ' ] = $ this ->icon : false ;
88105 isset ($ this ->title ) ? $ json ['chrome_title ' ] = $ this ->title : false ;
106+ isset ($ this ->image ) ? $ json ['chrome_image ' ] = $ this ->image : false ;
89107
90108 return $ json ;
91109
@@ -132,4 +150,18 @@ public function setTitle($title)
132150
133151 return $ this ;
134152 }
153+
154+ /**
155+ * Sets the image of the message.
156+ *
157+ * @param string $image The image of the message.
158+ *
159+ * @return \Gomoob\Pushwoosh\Model\Notification\Chrome this instance.
160+ */
161+ public function setImage ($ image )
162+ {
163+ $ this ->image = $ image ;
164+
165+ return $ this ;
166+ }
135167}
Original file line number Diff line number Diff line change @@ -55,6 +55,16 @@ public function testGetSetTitle()
5555 $ this ->assertSame ($ chrome , $ chrome ->setTitle ('Title ' ));
5656 $ this ->assertSame ('Title ' , $ chrome ->getTitle ());
5757 }
58+
59+ /**
60+ * Test method for the <code>#getImage()</code> and <code>#setImage($image)</code> functions.
61+ */
62+ public function testGetSetImage ()
63+ {
64+ $ chrome = new Chrome ();
65+ $ this ->assertSame ($ chrome , $ chrome ->setImage ('Image ' ));
66+ $ this ->assertSame ('Image ' , $ chrome ->getImage ());
67+ }
5868
5969 /**
6070 * Test method for the <code>#jsonSerialize()</code> function.
@@ -65,11 +75,13 @@ public function testJsonSerialize()
6575 ->setGcmTtl (3600 )
6676 ->setIcon ('icon ' )
6777 ->setTitle ('Title ' )
78+ ->setImage ('Image ' )
6879 ->jsonSerialize ();
6980
70- $ this ->assertCount (3 , $ array );
81+ $ this ->assertCount (4 , $ array );
7182 $ this ->assertSame (3600 , $ array ['chrome_gcm_ttl ' ]);
7283 $ this ->assertSame ('icon ' , $ array ['chrome_icon ' ]);
7384 $ this ->assertSame ('Title ' , $ array ['chrome_title ' ]);
85+ $ this ->assertSame ('Image ' , $ array ['chrome_image ' ]);
7486 }
7587}
Original file line number Diff line number Diff line change @@ -541,6 +541,7 @@ public function testJsonSerialize()
541541 ->setGcmTtl (3600 )
542542 ->setIcon ('icon ' )
543543 ->setTitle ('Title ' )
544+ ->setImage ('Image ' )
544545 )
545546 ->setIOS (
546547 IOS ::create ()
@@ -589,7 +590,7 @@ public function testJsonSerialize()
589590 ->jsonSerialize ();
590591
591592 // Test the generic properties
592- $ this ->assertCount (64 , $ array );
593+ $ this ->assertCount (65 , $ array );
593594 $ this ->assertSame ('now ' , $ array ['send_date ' ]);
594595 $ this ->assertSame ('America/New_York ' , $ array ['timezone ' ]);
595596 $ this ->assertTrue ($ array ['ignore_user_timezone ' ]);
@@ -666,6 +667,7 @@ public function testJsonSerialize()
666667 $ this ->assertSame (3600 , $ array ['chrome_gcm_ttl ' ]);
667668 $ this ->assertSame ('icon ' , $ array ['chrome_icon ' ]);
668669 $ this ->assertSame ('Title ' , $ array ['chrome_title ' ]);
670+ $ this ->assertSame ('Image ' , $ array ['chrome_image ' ]);
669671
670672 // Test IOS parameters
671673 $ this ->assertSame (1 , $ array ['apns_trim_content ' ]);
You can’t perform that action at this time.
0 commit comments