Commit 1e06a3ef authored by catch's avatar catch
Browse files

Issue #3093757 by bbrala, vsujeetkumar, jofitz, ridhimaabrol24, Berdir, xjm:...

Issue #3093757 by bbrala, vsujeetkumar, jofitz, ridhimaabrol24, Berdir, xjm: Test is marked skipped but shouldn't be anymore
parent fea3dd73
......@@ -196,13 +196,6 @@ protected function getExpectedCacheContexts(array $sparse_fieldset = NULL) {
return $contexts;
}
/**
* {@inheritdoc}
*/
public function testRelated() {
$this->markTestSkipped('Remove this in https://www.drupal.org/project/drupal/issues/2940339');
}
/**
* {@inheritdoc}
*/
......
......@@ -388,13 +388,6 @@ protected static function entityAccess(EntityInterface $entity, $operation, Acco
return parent::entityAccess($entity, $operation, $account);
}
/**
* {@inheritdoc}
*/
public function testRelated() {
$this->markTestSkipped('Remove this in https://www.drupal.org/project/drupal/issues/2940339');
}
/**
* {@inheritdoc}
*/
......
......@@ -172,13 +172,6 @@ protected function getExpectedUnauthorizedAccessMessage($method) {
}
}
/**
* {@inheritdoc}
*/
public function testRelated() {
$this->markTestSkipped('Remove this in https://www.drupal.org/project/drupal/issues/2940339');
}
/**
* {@inheritdoc}
*/
......
......@@ -1839,9 +1839,13 @@ protected function getExpectedRelatedResponse($relationship_field_name, array $r
'url.site',
], $this->entity->getEntityType()->isRevisionable() ? ['url.query_args:resourceVersion'] : []);
$cacheability = (new CacheableMetadata())->addCacheContexts($cache_contexts)->addCacheTags(['http_response']);
$related_response = isset($relationship_document['errors'])
? $relationship_response
: (new CacheableResourceResponse(static::getEmptyCollectionResponse(!is_null($relationship_document['data']), $self_link)->getResponseData()))->addCacheableDependency($cacheability);
if (isset($relationship_document['errors'])) {
$related_response = $relationship_response;
}
else {
$cardinality = is_null($relationship_document['data']) ? 1 : -1;
$related_response = (new CacheableResourceResponse(static::getEmptyCollectionResponse($cardinality, $self_link)->getResponseData()))->addCacheableDependency($cacheability);
}
}
else {
$is_to_one_relationship = static::isResourceIdentifier($relationship_document['data']);
......@@ -1857,7 +1861,8 @@ protected function getExpectedRelatedResponse($relationship_field_name, array $r
$related_response = static::toCollectionResourceResponse($individual_responses, $self_link, !$is_to_one_relationship);
}
else {
$related_response = static::getEmptyCollectionResponse(!$is_to_one_relationship, $self_link);
$cardinality = $is_to_one_relationship ? 1 : -1;
$related_response = static::getEmptyCollectionResponse($cardinality, $self_link);
}
}
$related_response->addCacheableDependency($relationship_response->getCacheableMetadata());
......
......@@ -469,13 +469,6 @@ public function providerTestGetIndividualTermWithParent() {
];
}
/**
* {@inheritdoc}
*/
public function testRelated() {
$this->markTestSkipped('Remove this in https://www.drupal.org/project/drupal/issues/2940339');
}
/**
* {@inheritdoc}
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment