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)
160160 *
161161 * @return \LaravelFCM\Message\OptionsBuilder
162162 *
163- * @throws InvalidOptionException
163+ * @throws InvalidOptionsException
164164 */
165165 public function setTimeToLive ($ timeToLive )
166166 {
167167 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 }" );
169169 }
170170 $ this ->timeToLive = $ timeToLive ;
171171
Original file line number Diff line number Diff line change 11<?php
22
3+ use LaravelFCM \Message \Exceptions \InvalidOptionsException ;
34use LaravelFCM \Message \OptionsBuilder ;
45use LaravelFCM \Message \OptionsPriorities ;
56use LaravelFCM \Message \PayloadDataBuilder ;
@@ -127,4 +128,16 @@ public function it_construct_a_valid_json_with_notification()
127128 $ json = json_encode ($ notificationBuilder ->build ()->toArray ());
128129 $ this ->assertJsonStringEqualsJsonString ($ targetFull , $ json );
129130 }
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+ }
130143}
You can’t perform that action at this time.
0 commit comments