function ResourceResponseTestTrait::toResourceIdentifier
Same name in other branches
- 9 core/modules/jsonapi/tests/src/Functional/ResourceResponseTestTrait.php \Drupal\Tests\jsonapi\Functional\ResourceResponseTestTrait::toResourceIdentifier()
- 8.9.x core/modules/jsonapi/tests/src/Functional/ResourceResponseTestTrait.php \Drupal\Tests\jsonapi\Functional\ResourceResponseTestTrait::toResourceIdentifier()
- 11.x core/modules/jsonapi/tests/src/Functional/ResourceResponseTestTrait.php \Drupal\Tests\jsonapi\Functional\ResourceResponseTestTrait::toResourceIdentifier()
Maps an entity to a resource identifier.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to map to a resource identifier.
Return value
array A resource identifier for the given entity.
7 calls to ResourceResponseTestTrait::toResourceIdentifier()
- ResourceResponseTestTrait::getExpectedIncludedResourceResponse in core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceResponseTestTrait.php - Gets an array of expected ResourceResponses for the given include paths.
- ResourceResponseTestTrait::getRelatedResponses in core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceResponseTestTrait.php - Gets an array of related responses for the given field names.
- ResourceResponseTestTrait::getRelationshipResponses in core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceResponseTestTrait.php - Gets an array of relationship responses for the given field names.
- ResourceTestBase::doTestRelationshipMutation in core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceTestBase.php - Performs one round of relationship POST, PATCH and DELETE route testing.
- ResourceTestBase::doTestSparseFieldSets in core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceTestBase.php - Tests sparse field sets.
File
-
core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceResponseTestTrait.php, line 263
Class
- ResourceResponseTestTrait
- Utility methods for handling resource responses.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected static function toResourceIdentifier(EntityInterface $entity) {
return [
'type' => $entity->getEntityTypeId() . '--' . $entity->bundle(),
'id' => $entity->uuid(),
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.