Skip to content

Commit

Permalink
Add missing external_user_id option to DeviceResolver (#110)
Browse files Browse the repository at this point in the history
* Add missing `external_user_id` option to DeviceResolver

* Add missing `external_user_id` option to DeviceResolver
  • Loading branch information
victor-pilotto authored and norkunas committed Jan 10, 2019
1 parent c5a5f59 commit 69f7654
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Resolver/DeviceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public function resolve(array $data)
->setAllowedTypes('lat', 'double')
->setDefined('country')
->setAllowedTypes('country', 'string')
->setDefined('external_user_id')
->setAllowedTypes('external_user_id', 'string')
->setDefault('app_id', $this->config->getApplicationId())
->setAllowedTypes('app_id', 'string');

Expand Down
2 changes: 2 additions & 0 deletions tests/OneSignal/Tests/Resolver/DeviceResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function testResolveWithValidValues()
'long' => 55.1684595,
'lat' => 22.7624291,
'country' => 'LT',
'external_user_id' => 'value',
'app_id' => 'value',
];

Expand Down Expand Up @@ -109,6 +110,7 @@ public function wrongValueTypesProvider()
[['country' => false]],
[['app_id' => 666]],
[['device_type' => 666]],
[['external_user_id' => 666]],
];
}

Expand Down

0 comments on commit 69f7654

Please sign in to comment.