function ResourceResponseTestTrait::isResourceIdentifier
Same name in other branches
- 9 core/modules/jsonapi/tests/src/Functional/ResourceResponseTestTrait.php \Drupal\Tests\jsonapi\Functional\ResourceResponseTestTrait::isResourceIdentifier()
- 10 core/modules/jsonapi/tests/src/Functional/ResourceResponseTestTrait.php \Drupal\Tests\jsonapi\Functional\ResourceResponseTestTrait::isResourceIdentifier()
- 11.x core/modules/jsonapi/tests/src/Functional/ResourceResponseTestTrait.php \Drupal\Tests\jsonapi\Functional\ResourceResponseTestTrait::isResourceIdentifier()
Checks if a given array is a resource identifier.
Parameters
array $data: An array to check.
Return value
bool TRUE if the array has a type and ID, FALSE otherwise.
4 calls to ResourceResponseTestTrait::isResourceIdentifier()
- ResourceResponseTestTrait::getResourceLink in core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceResponseTestTrait.php - Creates an individual resource link for a given resource identifier.
- ResourceResponseTestTrait::toCollectionResourceResponse in core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceResponseTestTrait.php - Merges individual responses into a collection response.
- ResourceTestBase::decorateExpectedResponseForIncludedFields in core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceTestBase.php - Decorates the expected response with included data and cache metadata.
- ResourceTestBase::getExpectedRelatedResponse in core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceTestBase.php - Builds an expected related ResourceResponse for the given field.
File
-
core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceResponseTestTrait.php, line 277
Class
- ResourceResponseTestTrait
- Utility methods for handling resource responses.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected static function isResourceIdentifier(array $data) {
return array_key_exists('type', $data) && array_key_exists('id', $data);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.