function MediaTest::getExpectedGetRelationshipDocumentData
Same name in other branches
- 9 core/modules/jsonapi/tests/src/Functional/MediaTest.php \Drupal\Tests\jsonapi\Functional\MediaTest::getExpectedGetRelationshipDocumentData()
- 10 core/modules/jsonapi/tests/src/Functional/MediaTest.php \Drupal\Tests\jsonapi\Functional\MediaTest::getExpectedGetRelationshipDocumentData()
- 11.x core/modules/jsonapi/tests/src/Functional/MediaTest.php \Drupal\Tests\jsonapi\Functional\MediaTest::getExpectedGetRelationshipDocumentData()
Overrides ResourceTestBase::getExpectedGetRelationshipDocumentData
File
-
core/
modules/ jsonapi/ tests/ src/ Functional/ MediaTest.php, line 359
Class
- MediaTest
- JSON:API integration test for the "Media" content entity type.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function getExpectedGetRelationshipDocumentData($relationship_field_name, EntityInterface $entity = NULL) {
$data = parent::getExpectedGetRelationshipDocumentData($relationship_field_name, $entity);
switch ($relationship_field_name) {
case 'thumbnail':
$data['meta'] = [
'alt' => '',
'width' => 180,
'height' => 180,
'title' => NULL,
];
return $data;
case 'field_media_file':
$data['meta'] = [
'description' => NULL,
'display' => NULL,
];
return $data;
default:
return $data;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.