This repository was archived by the owner on Jun 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -160,12 +160,12 @@ public function setDelayWhileIdle($delayWhileIdle)
160
160
*
161
161
* @return \LaravelFCM\Message\OptionsBuilder
162
162
*
163
- * @throws InvalidOptionException
163
+ * @throws InvalidOptionsException
164
164
*/
165
165
public function setTimeToLive ($ timeToLive )
166
166
{
167
167
if ($ timeToLive < 0 || $ timeToLive > 2419200 ) {
168
- throw new InvalidOptionException ("time to live must be between 0 and 2419200, current value is: {$ timeToLive }" );
168
+ throw new InvalidOptionsException ("time to live must be between 0 and 2419200, current value is: {$ timeToLive }" );
169
169
}
170
170
$ this ->timeToLive = $ timeToLive ;
171
171
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ use LaravelFCM \Message \Exceptions \InvalidOptionsException ;
3
4
use LaravelFCM \Message \OptionsBuilder ;
4
5
use LaravelFCM \Message \OptionsPriorities ;
5
6
use LaravelFCM \Message \PayloadDataBuilder ;
@@ -127,4 +128,16 @@ public function it_construct_a_valid_json_with_notification()
127
128
$ json = json_encode ($ notificationBuilder ->build ()->toArray ());
128
129
$ this ->assertJsonStringEqualsJsonString ($ targetFull , $ json );
129
130
}
131
+
132
+ /**
133
+ * @test
134
+ */
135
+ public function it_throws_an_invalidoptionsexception_if_the_interval_is_too_big ()
136
+ {
137
+ $ this ->setExpectedException (InvalidOptionsException::class);
138
+
139
+ $ optionBuilder = new OptionsBuilder ();
140
+ $ optionBuilder ->setTimeToLive (2419200 * 10 );
141
+
142
+ }
130
143
}
You can’t perform that action at this time.
0 commit comments