Skip to content

Commit c8eb8f5

Browse files
authored
Update NotificationResolver.php for support ios_interruption_level (#171)
* Update NotificationResolver.php for support ios_interruption_level Update NotificationResolver.php for support ios_interruption_level please check https://documentation.onesignal.com/reference/push-channel-properties#grouping--collapsing * Update NotificationResolverTest.php for test add test for ios_interruption_level * Update NotificationsTest.php for test add test for ios_interruption_level * Update notifications_get_all.json for test
1 parent 982c13c commit c8eb8f5

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

src/Resolver/NotificationResolver.php

+2
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ public function resolve(array $data): array
216216
->setAllowedTypes('summary_arg', 'string')
217217
->setDefined('summary_arg_count')
218218
->setAllowedTypes('summary_arg_count', 'int')
219+
->setDefined('ios_interruption_level')
220+
->setAllowedTypes('ios_interruption_level', 'string')
219221
->setDefined('ttl')
220222
->setAllowedTypes('ttl', 'int')
221223
->setDefined('priority')

tests/Fixtures/notifications_get_all.json

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"tags": null,
8686
"filters": null,
8787
"template_id": null,
88+
"ios_interruption_level": "active",
8889
"ttl": null,
8990
"url": "https://mysite.com",
9091
"web_url": null,

tests/NotificationsTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public function testGetAll(): void
161161
'tags' => null,
162162
'filters' => null,
163163
'template_id' => null,
164+
'ios_interruption_level' => 'active',
164165
'ttl' => null,
165166
'url' => 'https://mysite.com',
166167
'web_url' => null,

tests/Resolver/NotificationResolverTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public function testResolveWithValidValues(): void
114114
'thread_id' => 'value',
115115
'summary_arg' => 'value',
116116
'summary_arg_count' => 10,
117+
'ios_interruption_level' => 'value',
117118
'ttl' => 23,
118119
'priority' => 10,
119120
'app_id' => 'value',
@@ -212,6 +213,7 @@ public function wrongValueTypesProvider(): iterable
212213
yield [['android_group_message' => 666]];
213214
yield [['adm_group' => 666]];
214215
yield [['adm_group_message' => 666]];
216+
yield [['ios_interruption_level' => 666]];
215217
yield [['ttl' => 'wrongType']];
216218
yield [['priority' => 'wrongType']];
217219
yield [['app_id' => 666]];

0 commit comments

Comments
 (0)