Skip to content

Commit 8b486ac

Browse files
committed
test: relationship with meta in the resource identifier object
1 parent 0695ad4 commit 8b486ac

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/ItemTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,9 @@ public function itCanGetAllRelationships()
511511
$masterItem = new MasterItem();
512512
$childItem = new ChildItem();
513513
$childItem->setId('1');
514+
$childItem->setMeta(new Meta(['foo' => 'bar']));
514515
$masterItem->child()->associate($childItem);
516+
$masterItem->children()->associate(new Collection([$childItem]));
515517

516518
$relations = $masterItem->getRelationships();
517519

@@ -520,6 +522,20 @@ public function itCanGetAllRelationships()
520522
'data' => [
521523
'type' => 'child',
522524
'id' => '1',
525+
'meta' => [
526+
'foo' => 'bar',
527+
],
528+
],
529+
],
530+
'children' => [
531+
'data' => [
532+
[
533+
'type' => 'child',
534+
'id' => '1',
535+
'meta' => [
536+
'foo' => 'bar',
537+
],
538+
],
523539
],
524540
],
525541
], $relations);

0 commit comments

Comments
 (0)