function DesignTokenTest::getExpectedDocument
Same name and namespace in other branches
- 11.x core/modules/jsonapi/tests/src/Functional/DesignTokenTest.php \Drupal\Tests\jsonapi\Functional\DesignTokenTest::getExpectedDocument()
File
-
core/
modules/ jsonapi/ tests/ src/ Functional/ DesignTokenTest.php, line 75
Class
- DesignTokenTest
- JSON:API integration test for the "DesignToken" config entity type.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected function getExpectedDocument() : array {
$self_url = Url::fromUri('base:/jsonapi/design_token/design_token/' . $this->entity
->uuid())
->setAbsolute()
->toString(TRUE)
->getGeneratedUrl();
return [
'jsonapi' => [
'meta' => [
'links' => [
'self' => [
'href' => JsonApiSpec::SUPPORTED_SPECIFICATION_PERMALINK,
],
],
],
'version' => JsonApiSpec::SUPPORTED_SPECIFICATION_VERSION,
],
'links' => [
'self' => [
'href' => $self_url,
],
],
'data' => [
'id' => $this->entity
->uuid(),
'type' => 'design_token--design_token',
'links' => [
'self' => [
'href' => $self_url,
],
],
'attributes' => [
'dependencies' => [],
'langcode' => 'en',
'status' => TRUE,
'path' => 'my-token',
'design_token_type' => 'fontWeight',
'scopes' => [
':root' => '500',
],
'drupal_internal__id' => 'my_token',
],
],
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.