$this->
markTestSkipped('PATCHing config entities is not yet supported.'
);
} // Patch testing requires that another entity of the same type exists.
$this->anotherEntity =
$this->
createAnotherEntity();
$this->
initAuthentication();
$has_canonical_url =
$this->entity->
hasLinkTemplate('canonical'
);
// Try with all of the following request bodies.
$unparseable_request_body = '!{>}<';
$parseable_valid_request_body =
$this->serializer->
encode($this->
getNormalizedPatchEntity(),
static::
$format);
$parseable_invalid_request_body =
$this->serializer->
encode($this->
makeNormalizationInvalid($this->
getNormalizedPatchEntity(), 'label'
),
static::
$format);
$parseable_invalid_request_body_2 =
$this->serializer->
encode($this->
getNormalizedPatchEntity() +
['field_rest_test' =>
[['value' =>
$this->
randomString()]]],
static::
$format);
// The 'field_rest_test' field does not allow 'view' access, so does not end
// up in the normalization. Even when we explicitly add it the normalization
// that we send in the body of a PATCH request, it is considered invalid.
$parseable_invalid_request_body_3 =
$this->serializer->
encode($this->
getNormalizedPatchEntity() +
['field_rest_test' =>
$this->entity->
get('field_rest_test'
)->
getValue()],
static::
$format);
// The URL and Guzzle request options that will be used in this test. The
// request options will be modified/expanded throughout this test:
// - to first test all mistakes a developer might make, and assert that the
// error responses provide a good DX