Skip to content

Commit 53a6dc0

Browse files
authored
Merge pull request #142 from gkreitz/resourceId_and_tag_in_DeepLinkResource
Include `resourceId` and `tag` of line items in deep link resource
2 parents 06f7723 + a63d6f9 commit 53a6dc0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/DeepLinkResources/Resource.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public function getArray(): array
5151
$resource['lineItem'] = [
5252
'scoreMaximum' => $this->line_item->getScoreMaximum(),
5353
'label' => $this->line_item->getLabel(),
54+
'resourceId' => $this->line_item->getResourceId(),
55+
'tag' => $this->line_item->getTag(),
5456
];
5557
}
5658

tests/DeepLinkResources/ResourceTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ public function testItCreatesArrayWithDefinedOptionalProperties()
276276
'lineItem' => [
277277
'scoreMaximum' => 80,
278278
'label' => 'lineitem_label',
279+
'resourceId' => 'lineitem_resourceId',
280+
'tag' => 'lineitem_tag',
279281
],
280282
'iframe' => $Iframe->toArray(),
281283
'window' => $window->toArray(),
@@ -288,6 +290,10 @@ public function testItCreatesArrayWithDefinedOptionalProperties()
288290
->twice()->andReturn($expected['lineItem']['scoreMaximum']);
289291
$lineitem->shouldReceive('getLabel')
290292
->twice()->andReturn($expected['lineItem']['label']);
293+
$lineitem->shouldReceive('getResourceId')
294+
->twice()->andReturn($expected['lineItem']['resourceId']);
295+
$lineitem->shouldReceive('getTag')
296+
->twice()->andReturn($expected['lineItem']['tag']);
291297

292298
$this->resource->setTitle($expected['title']);
293299
$this->resource->setText($expected['text']);

0 commit comments

Comments
 (0)