Skip to content

Commit

Permalink
Correct loc-key & loc-args key names (#10)
Browse files Browse the repository at this point in the history
* Fix title loc key names
* Adapt test for title-loc key changes
* Fix #5
  • Loading branch information
edwardmp authored and edamov committed Feb 16, 2017
1 parent 9e77920 commit 66ee23d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Payload/Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class Alert implements \JsonSerializable
{
const ALERT_TITLE_KEY = 'title';
const ALERT_BODY_KEY = 'body';
const ALERT_TITLE_LOC_KEY = 'title-loc-key';
const ALERT_TITLE_LOC_ARGS_KEY = 'title-loc-args';
const ALERT_TITLE_LOC_KEY = 'loc-key';
const ALERT_TITLE_LOC_ARGS_KEY = 'loc-args';
const ALERT_ACTION_LOC_KEY = 'action-loc-key';
const ALERT_LOC_KEY = 'loc-key';
const ALERT_LOC_ARGS_KEY = 'loc-args';
Expand Down
10 changes: 5 additions & 5 deletions tests/Payload/AlertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public function testSetBody()

public function testSetTitleLocKey()
{
$alert = Alert::create()->setTitleLocKey('title-loc-key');
$alert = Alert::create()->setTitleLocKey('loc-key');

$this->assertEquals('title-loc-key', $alert->getTitleLocKey());
$this->assertEquals('loc-key', $alert->getTitleLocKey());
}

public function testSetTitleLocArgs()
Expand Down Expand Up @@ -84,16 +84,16 @@ public function testAlertConvertingToJson()
$alert = Alert::create()
->setTitle('title')
->setBody('body')
->setTitleLocKey('title-loc-key')
->setTitleLocArgs(['title-loc-arg'])
->setTitleLocKey('loc-key')
->setTitleLocArgs(['loc-arg'])
->setActionLocKey('action-loc-key')
->setLocKey('loc-key')
->setLocArgs(['loc-arg'])
->setLaunchImage('launch-image')
->setMutableContent(true);

$this->assertJsonStringEqualsJsonString(
'{"title":"title","body":"body","title-loc-key":"title-loc-key","title-loc-args":["title-loc-arg"],' .
'{"title":"title","body":"body","loc-key":"loc-key","loc-args":["loc-arg"],' .
'"action-loc-key":"action-loc-key","loc-key":"loc-key","loc-args":["loc-arg"],' .
'"launch-image":"launch-image","mutable-content":1}',
$alert->toJson()
Expand Down

0 comments on commit 66ee23d

Please sign in to comment.