You are here

protected function TermTest::getExpectedGetRelationshipDocumentData in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Functional/TermTest.php \Drupal\Tests\jsonapi\Functional\TermTest::getExpectedGetRelationshipDocumentData()
  2. 9 core/modules/jsonapi/tests/src/Functional/TermTest.php \Drupal\Tests\jsonapi\Functional\TermTest::getExpectedGetRelationshipDocumentData()

File

core/modules/jsonapi/tests/src/Functional/TermTest.php, line 322

Class

TermTest
JSON:API integration test for the "Term" content entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function getExpectedGetRelationshipDocumentData($relationship_field_name, EntityInterface $entity = NULL) {
  $data = parent::getExpectedGetRelationshipDocumentData($relationship_field_name, $entity);
  if ($relationship_field_name === 'parent') {
    $data = [
      0 => [
        'id' => 'virtual',
        'type' => 'taxonomy_term--camelids',
        'meta' => [
          'links' => [
            'help' => [
              'href' => 'https://www.drupal.org/docs/8/modules/json-api/core-concepts#virtual',
              'meta' => [
                'about' => "Usage and meaning of the 'virtual' resource identifier.",
              ],
            ],
          ],
        ],
      ],
    ];
  }
  return $data;
}