tests/src/Functional/ResourceTestBase.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/src/Functional/ResourceTestBase.php b/tests/src/Functional/ResourceTestBase.php index aeb81c8..5cc5656 100644 --- a/tests/src/Functional/ResourceTestBase.php +++ b/tests/src/Functional/ResourceTestBase.php @@ -1329,21 +1329,20 @@ abstract class ResourceTestBase extends BrowserTestBase { $expected_resource_response = $expected_relationship_responses[$relationship_field_name]; /* @var \Psr\Http\Message\ResponseInterface $actual_response */ $actual_response = $related_responses[$relationship_field_name]; - // @todo uncomment this assertion in https://www.drupal.org/project/jsonapi/issues/2929428 // Dynamic Page Cache miss because cache should vary based on the // 'include' query param. - // @codingStandardsIgnoreStart - //$expected_cacheability = $expected_resource_response->getCacheableMetadata(); - //$this->assertResourceResponse( - // $expected_resource_response->getStatusCode(), - // $expected_document, - // $actual_response, - // $expected_cacheability->getCacheTags(), - // \Drupal::service('cache_contexts_manager')->optimizeTokens($expected_cacheability->getCacheContexts()), - // FALSE, - // $expected_cacheability->getCacheMaxAge() === 0 ? 'UNCACHEABLE' : 'MISS' - //); - // @codingStandardsIgnoreEnd + $expected_cacheability = $expected_resource_response->getCacheableMetadata(); + $this->assertResourceResponse( + $expected_resource_response->getStatusCode(), + FALSE, + $actual_response, + $expected_cacheability->getCacheTags(), + \Drupal::service('cache_contexts_manager')->optimizeTokens($expected_cacheability->getCacheContexts()), + FALSE, + $actual_response->getStatusCode() === 200 + ? ($expected_cacheability->getCacheMaxAge() === 0 ? 'UNCACHEABLE' : 'MISS') + : FALSE + ); $this->assertSame($expected_resource_response->getStatusCode(), $actual_response->getStatusCode()); $expected_document = $expected_resource_response->getResponseData(); $actual_document = Json::decode((string) $actual_response->getBody());