diff --git a/tests/src/Functional/MediaTest.php b/tests/src/Functional/MediaTest.php index dd37cfe..41f2a15 100644 --- a/tests/src/Functional/MediaTest.php +++ b/tests/src/Functional/MediaTest.php @@ -306,20 +306,27 @@ class MediaTest extends ResourceTestBase { * @todo Determine if this override should be removed in https://www.drupal.org/project/jsonapi/issues/2952522 */ protected function getExpectedGetRelationshipDocumentData($relationship_field_name) { - if ($relationship_field_name === 'thumbnail') { - $thumbnail = File::load(2); - return [ - 'id' => $thumbnail->uuid(), - 'type' => 'file--file', - 'meta' => [ + $data = parent::getExpectedGetRelationshipDocumentData($relationship_field_name); + switch ($relationship_field_name) { + case 'thumbnail': + $data['meta'] = [ 'alt' => 'Thumbnail', 'width' => '180', 'height' => '180', 'title' => 'Llama', - ], - ]; + ]; + return $data; + + case 'field_media_file': + $data['meta'] = [ + 'description' => NULL, + 'display' => NULL, + ]; + return $data; + + default: + return $data; } - return parent::getExpectedGetRelationshipDocumentData($relationship_field_name); } }