Issue #3173076 by anmolgoyal74, shetpooja04, sulfikar_s, Pooja Ganjage, longwave, alexpott: Unused variable $parseable_valid_request_body_2 in EntityResourceTestBase.php, rest module
parent
5e27a9f44c
commit
e37745362c
|
@ -1883,7 +1883,6 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
|||
// Try with all of the following request bodies.
|
||||
$unparseable_request_body = '!{>}<';
|
||||
$parseable_valid_request_body = Json::encode($this->getPostDocument());
|
||||
/* $parseable_valid_request_body_2 = Json::encode($this->getNormalizedPostEntity()); */
|
||||
$parseable_invalid_request_body_missing_type = Json::encode($this->removeResourceTypeFromDocument($this->getPostDocument()));
|
||||
if ($this->entity->getEntityType()->hasKey('label')) {
|
||||
$parseable_invalid_request_body = Json::encode($this->makeNormalizationInvalid($this->getPostDocument(), 'label'));
|
||||
|
@ -2105,7 +2104,6 @@ abstract class ResourceTestBase extends BrowserTestBase {
|
|||
// Try with all of the following request bodies.
|
||||
$unparseable_request_body = '!{>}<';
|
||||
$parseable_valid_request_body = Json::encode($this->getPatchDocument());
|
||||
/* $parseable_valid_request_body_2 = Json::encode($this->getNormalizedPatchEntity()); */
|
||||
if ($this->entity->getEntityType()->hasKey('label')) {
|
||||
$parseable_invalid_request_body = Json::encode($this->makeNormalizationInvalid($this->getPatchDocument(), 'label'));
|
||||
}
|
||||
|
|
|
@ -298,23 +298,6 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
|
|||
return $this->getNormalizedPostEntity();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the second normalized POST entity.
|
||||
*
|
||||
* Entity types can have non-sequential IDs, and in that case the second
|
||||
* entity created for POST testing needs to be able to specify a different ID.
|
||||
*
|
||||
* @see ::testPost
|
||||
* @see ::getNormalizedPostEntity
|
||||
*
|
||||
* @return array
|
||||
* An array structure as returned by ::getNormalizedPostEntity().
|
||||
*/
|
||||
protected function getSecondNormalizedPostEntity() {
|
||||
// Return the values of the "parent" method by default.
|
||||
return $this->getNormalizedPostEntity();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the normalized POST entity with random values for its unique fields.
|
||||
*
|
||||
|
@ -718,7 +701,6 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
|
|||
// Try with all of the following request bodies.
|
||||
$unparseable_request_body = '!{>}<';
|
||||
$parseable_valid_request_body = $this->serializer->encode($this->getNormalizedPostEntity(), static::$format);
|
||||
$parseable_valid_request_body_2 = $this->serializer->encode($this->getSecondNormalizedPostEntity(), static::$format);
|
||||
$parseable_invalid_request_body = $this->serializer->encode($this->makeNormalizationInvalid($this->getNormalizedPostEntity(), 'label'), static::$format);
|
||||
$parseable_invalid_request_body_2 = $this->serializer->encode($this->getNormalizedPostEntity() + ['uuid' => [$this->randomMachineName(129)]], static::$format);
|
||||
$parseable_invalid_request_body_3 = $this->serializer->encode($this->getNormalizedPostEntity() + ['field_rest_test' => [['value' => $this->randomString()]]], static::$format);
|
||||
|
@ -897,7 +879,6 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
|
|||
// Try with all of the following request bodies.
|
||||
$unparseable_request_body = '!{>}<';
|
||||
$parseable_valid_request_body = $this->serializer->encode($this->getNormalizedPatchEntity(), static::$format);
|
||||
$parseable_valid_request_body_2 = $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
|
||||
|
|
|
@ -159,16 +159,6 @@ abstract class WorkspaceResourceTestBase extends EntityResourceTestBase {
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getSecondNormalizedPostEntity() {
|
||||
$normalized_post_entity = $this->getNormalizedPostEntity();
|
||||
$normalized_post_entity['id'][0]['value'] = static::$secondCreatedEntityId;
|
||||
|
||||
return $normalized_post_entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue