diff --git a/src/Payload/Alert.php b/src/Payload/Alert.php index 0768d72..46c0959 100644 --- a/src/Payload/Alert.php +++ b/src/Payload/Alert.php @@ -23,8 +23,8 @@ class Alert implements \JsonSerializable const ALERT_TITLE_KEY = 'title'; const ALERT_SUBTITLE = 'subtitle'; const ALERT_BODY_KEY = 'body'; - const ALERT_TITLE_LOC_KEY = 'loc-key'; - const ALERT_TITLE_LOC_ARGS_KEY = 'loc-args'; + const ALERT_TITLE_LOC_KEY = 'title-loc-key'; + const ALERT_TITLE_LOC_ARGS_KEY = 'title-loc-args'; const ALERT_ACTION_LOC_KEY = 'action-loc-key'; const ALERT_LOC_KEY = 'loc-key'; const ALERT_LOC_ARGS_KEY = 'loc-args'; diff --git a/tests/Payload/AlertTest.php b/tests/Payload/AlertTest.php index ccb040d..65c033f 100644 --- a/tests/Payload/AlertTest.php +++ b/tests/Payload/AlertTest.php @@ -32,9 +32,9 @@ public function testSetBody() public function testSetTitleLocKey() { - $alert = Alert::create()->setTitleLocKey('loc-key'); + $alert = Alert::create()->setTitleLocKey('title-loc-key'); - $this->assertEquals('loc-key', $alert->getTitleLocKey()); + $this->assertEquals('title-loc-key', $alert->getTitleLocKey()); } public function testSetTitleLocArgs() @@ -77,7 +77,7 @@ public function testAlertConvertingToJson() $alert = Alert::create() ->setTitle('title') ->setBody('body') - ->setTitleLocKey('loc-key') + ->setTitleLocKey('title-loc-key') ->setTitleLocArgs(['loc-arg']) ->setActionLocKey('action-loc-key') ->setLocKey('loc-key') @@ -85,7 +85,7 @@ public function testAlertConvertingToJson() ->setLaunchImage('launch-image'); $this->assertJsonStringEqualsJsonString( - '{"title":"title","body":"body","loc-key":"loc-key","loc-args":["loc-arg"],' . + '{"title":"title","body":"body","title-loc-key":"title-loc-key","title-loc-args":["loc-arg"],' . '"action-loc-key":"action-loc-key","loc-key":"loc-key","loc-args":["loc-arg"],' . '"launch-image":"launch-image"}', $alert->toJson()