// Fetch the published revision by using the `rel` version negotiator and
// the `latest-version` version argument. With content_moderation, this is
// now the most recent revision where the moderation state was the 'default'
// one.
$actual_response =
$this->
request('GET',
$rel_latest_version_url,
$request_options);
$expected_document['data'
]['attributes'
][$revision_id_key] =
$default_revision_id;
$expected_document['data'
]['attributes'
]['moderation_state'
] = 'published';
$expected_document['data'
]['attributes'
][$published_key] = TRUE;
$expected_document['data'
]['attributes'
]['field_revisionable_number'
] = 99;
$expected_document['links'
]['self'
]['href'
] =
$rel_latest_version_url->
toString();
$expected_document['data'
]['attributes'
][$revision_translation_affected_key] =
$entity->
isRevisionTranslationAffected();
// The resource object now must link to the new revision.
$default_revision_id_url =
clone $url;
$default_revision_id_url =
$default_revision_id_url->
setOption('query',
['resourceVersion' => "id:
$default_revision_id"
]);
$expected_document['data'
]['links'
]['self'
]['href'
] =
$default_revision_id_url->
setAbsolute()->
toString();
$amend_relationship_urls($expected_document,
$default_revision_id);
// Since the requested version is the latest version and working copy, there
// should be no links.
unset($expected_document['data'
]['links'
]['latest-version'
]);
unset($expected_document['data'
]['links'
]['working-copy'
]);
$this->
assertResourceResponse(200,
$expected_document,
$actual_response,
$expected_cache_tags,
$expected_cache_contexts, FALSE, 'MISS'
);
// Fetch the collection URL using the `latest-version` version argument.