From a5ea82b43ae3f4d67a49ca55c3a6c2605d453645 Mon Sep 17 00:00:00 2001 From: nwilging Date: Tue, 18 Apr 2023 17:36:21 -0400 Subject: [PATCH] fix fields in generic embed update test --- src/Support/Embeds/GenericEmbed.php | 2 +- tests/Unit/Support/Embeds/GenericEmbedTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Support/Embeds/GenericEmbed.php b/src/Support/Embeds/GenericEmbed.php index e5643c5..fb3be4d 100644 --- a/src/Support/Embeds/GenericEmbed.php +++ b/src/Support/Embeds/GenericEmbed.php @@ -93,7 +93,7 @@ public function toArray(): array 'provider' => $this->provider?->toArray(), 'author' => $this->author?->toArray(), 'fields' => array_map(function (FieldEmbed $field): array { - return $field->toArray(); + return $field->toArray()['field']; }, $this->fields), ]); } diff --git a/tests/Unit/Support/Embeds/GenericEmbedTest.php b/tests/Unit/Support/Embeds/GenericEmbedTest.php index b8e4ff7..81324a6 100644 --- a/tests/Unit/Support/Embeds/GenericEmbedTest.php +++ b/tests/Unit/Support/Embeds/GenericEmbedTest.php @@ -84,8 +84,8 @@ public function testEmbedWithAllOptions() 'thumbnail' => $thumbnail->toArray(), 'video' => $video->toArray(), 'fields' => [ - $field1->toArray(), - $field2->toArray(), + $field1->toArray()['field'], + $field2->toArray()['field'], ], ], $embed->toArray()); }