.../Value/RelationshipNormalizerValueTest.php | 49 +++++++--------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/tests/src/Unit/Normalizer/Value/RelationshipNormalizerValueTest.php b/tests/src/Unit/Normalizer/Value/RelationshipNormalizerValueTest.php index 74ee90f..eb4f87c 100644 --- a/tests/src/Unit/Normalizer/Value/RelationshipNormalizerValueTest.php +++ b/tests/src/Unit/Normalizer/Value/RelationshipNormalizerValueTest.php @@ -130,7 +130,8 @@ class RelationshipNormalizerValueTest extends UnitTestCase { 'multiple cardinality, all same values' => [ [$uid1->reveal(), $uid1->reveal()], 2, [ 'data' => [ - ['type' => 'user', 'id' => 1, 'meta' => ['arity' => 2]], + ['type' => 'user', 'id' => 1, 'meta' => ['arity' => 0]], + ['type' => 'user', 'id' => 1, 'meta' => ['arity' => 1]], ], 'links' => $links, ], @@ -142,8 +143,9 @@ class RelationshipNormalizerValueTest extends UnitTestCase { 'multiple cardinality, some same values' => [ [$uid1->reveal(), $uid2->reveal(), $uid1->reveal()], 2, [ 'data' => [ - ['type' => 'user', 'id' => 1, 'meta' => ['arity' => 2]], + ['type' => 'user', 'id' => 1, 'meta' => ['arity' => 0]], ['type' => 'user', 'id' => 2], + ['type' => 'user', 'id' => 1, 'meta' => ['arity' => 1]], ], 'links' => $links, ], @@ -164,16 +166,8 @@ class RelationshipNormalizerValueTest extends UnitTestCase { 'multiple cardinality, all same values, with meta' => [ [$img1->reveal(), $img1->reveal()], 2, [ 'data' => [ - [ - 'type' => 'file--file', - 'id' => $img_id, - 'meta' => [ - 'arity' => 2, - 'metas' => [ - ['alt' => 'Cute llama', 'title' => 'My spirit animal'], - ], - ], - ], + ['type' => 'file--file', 'id' => $img_id, 'meta' => ['alt' => 'Cute llama', 'title' => 'My spirit animal', 'arity' => 0]], + ['type' => 'file--file', 'id' => $img_id, 'meta' => ['alt' => 'Cute llama', 'title' => 'My spirit animal', 'arity' => 1]], ], 'links' => $links, ], @@ -185,17 +179,9 @@ class RelationshipNormalizerValueTest extends UnitTestCase { 'multiple cardinality, some same values with same values but different meta' => [ [$img1->reveal(), $img1->reveal(), $img2->reveal()], 2, [ 'data' => [ - [ - 'type' => 'file--file', - 'id' => $img_id, - 'meta' => [ - 'arity' => 3, - 'metas' => [ - ['alt' => 'Cute llama', 'title' => 'My spirit animal'], - ['alt' => 'Adorable llama', 'title' => 'My spirit animal 😍'], - ], - ], - ], + ['type' => 'file--file', 'id' => $img_id, 'meta' => ['alt' => 'Cute llama', 'title' => 'My spirit animal', 'arity' => 0]], + ['type' => 'file--file', 'id' => $img_id, 'meta' => ['alt' => 'Cute llama', 'title' => 'My spirit animal', 'arity' => 1]], + ['type' => 'file--file', 'id' => $img_id, 'meta' => ['alt' => 'Adorable llama', 'title' => 'My spirit animal 😍', 'arity' => 2]], ], 'links' => $links, ], @@ -207,19 +193,12 @@ class RelationshipNormalizerValueTest extends UnitTestCase { 'all the edge cases!' => [ [$img1->reveal(), $img1->reveal(), $img2->reveal(), $uid1->reveal(), $uid2->reveal(), $uid1->reveal()], 10, [ 'data' => [ - [ - 'type' => 'file--file', - 'id' => $img_id, - 'meta' => [ - 'arity' => 3, - 'metas' => [ - ['alt' => 'Cute llama', 'title' => 'My spirit animal'], - ['alt' => 'Adorable llama', 'title' => 'My spirit animal 😍'], - ], - ], - ], - ['type' => 'user', 'id' => 1, 'meta' => ['arity' => 2]], + ['type' => 'file--file', 'id' => $img_id, 'meta' => ['alt' => 'Cute llama', 'title' => 'My spirit animal', 'arity' => 0]], + ['type' => 'file--file', 'id' => $img_id, 'meta' => ['alt' => 'Cute llama', 'title' => 'My spirit animal', 'arity' => 1]], + ['type' => 'file--file', 'id' => $img_id, 'meta' => ['alt' => 'Adorable llama', 'title' => 'My spirit animal 😍', 'arity' => 2]], + ['type' => 'user', 'id' => 1, 'meta' => ['arity' => 0]], ['type' => 'user', 'id' => 2], + ['type' => 'user', 'id' => 1, 'meta' => ['arity' => 1]], ], 'links' => $links, ],