Skip to content

Commit

Permalink
Update NotificationResolver.php for support ios_interruption_level (#171
Browse files Browse the repository at this point in the history
)

* 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
  • Loading branch information
Eundong authored May 10, 2023
1 parent 982c13c commit c8eb8f5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Resolver/NotificationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ public function resolve(array $data): array
->setAllowedTypes('summary_arg', 'string')
->setDefined('summary_arg_count')
->setAllowedTypes('summary_arg_count', 'int')
->setDefined('ios_interruption_level')
->setAllowedTypes('ios_interruption_level', 'string')
->setDefined('ttl')
->setAllowedTypes('ttl', 'int')
->setDefined('priority')
Expand Down
1 change: 1 addition & 0 deletions tests/Fixtures/notifications_get_all.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"tags": null,
"filters": null,
"template_id": null,
"ios_interruption_level": "active",
"ttl": null,
"url": "https://mysite.com",
"web_url": null,
Expand Down
1 change: 1 addition & 0 deletions tests/NotificationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public function testGetAll(): void
'tags' => null,
'filters' => null,
'template_id' => null,
'ios_interruption_level' => 'active',
'ttl' => null,
'url' => 'https://mysite.com',
'web_url' => null,
Expand Down
2 changes: 2 additions & 0 deletions tests/Resolver/NotificationResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function testResolveWithValidValues(): void
'thread_id' => 'value',
'summary_arg' => 'value',
'summary_arg_count' => 10,
'ios_interruption_level' => 'value',
'ttl' => 23,
'priority' => 10,
'app_id' => 'value',
Expand Down Expand Up @@ -212,6 +213,7 @@ public function wrongValueTypesProvider(): iterable
yield [['android_group_message' => 666]];
yield [['adm_group' => 666]];
yield [['adm_group_message' => 666]];
yield [['ios_interruption_level' => 666]];
yield [['ttl' => 'wrongType']];
yield [['priority' => 'wrongType']];
yield [['app_id' => 666]];
Expand Down

0 comments on commit c8eb8f5

Please sign in to comment.