function InternalEntitiesTest::testLinks

Same name and namespace in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php \Drupal\Tests\jsonapi\Functional\InternalEntitiesTest::testLinks()
  2. 10 core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php \Drupal\Tests\jsonapi\Functional\InternalEntitiesTest::testLinks()
  3. 11.x core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php \Drupal\Tests\jsonapi\Functional\InternalEntitiesTest::testLinks()

Asserts that links to internal relationships aren't generated.

File

core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php, line 136

Class

InternalEntitiesTest
Makes assertions about the JSON:API behavior for internal entities.

Namespace

Drupal\Tests\jsonapi\Functional

Code

public function testLinks() {
    $document = $this->getIndividual($this->referencingEntity);
    $this->assertArrayNotHasKey('related', $document['data']['relationships']['field_internal']['links'], 'Links to internal-only related routes should not be in the document.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.