public function InternalEntitiesTest::testLinks in JSON:API 8.2
Same name and namespace in other branches
- 8 tests/src/Functional/InternalEntitiesTest.php \Drupal\Tests\jsonapi\Functional\InternalEntitiesTest::testLinks()
Asserts that links to internal relationships aren't generated.
File
- tests/
src/ Functional/ InternalEntitiesTest.php, line 131
Class
- InternalEntitiesTest
- Makes assertions about the JSON:API behavior for internal entities.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
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.');
}