Skip to content

Commit 1f41019

Browse files
committed
B2B-2471: Defects in CatalogUrlResolverIdentity and CmsUrlResolverIdentity prevent caching
1 parent 967439a commit 1f41019

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache/UrlRewrite/RouteCacheTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testProductUrlResolver()
4646
$productSku = 'p002';
4747
/** @var ProductRepositoryInterface $productRepository */
4848
$productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
49-
$product = $productRepository->get($productSku, false, null, true);
49+
$productRepository->get($productSku, false, null, true);
5050

5151
$routeQuery = $this->getRouteQuery($this->getProductUrlKey($productSku));
5252
$response = $this->graphQlQueryWithResponseHeaders($routeQuery);
@@ -71,7 +71,7 @@ public function testProductUrlWithNonSeoFriendlyUrlInput()
7171
$productSku = 'p002';
7272
/** @var ProductRepositoryInterface $productRepository */
7373
$productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
74-
$product = $productRepository->get($productSku, false, null, true);
74+
$productRepository->get($productSku, false, null, true);
7575

7676
$actualUrls = $this->getProductUrlRewriteData($productSku);
7777
$nonSeoFriendlyPath = $actualUrls->getTargetPath();
@@ -100,7 +100,7 @@ public function testProductUrlRewriteResolver()
100100
/** @var ProductRepositoryInterface $productRepository */
101101
$productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
102102
$product = $productRepository->get($productSku, false, null, true);
103-
$initialUrlPath = $this->getProductUrlKey($productSku);
103+
$this->getProductUrlKey($productSku);
104104
$renamedKey = 'simple-product-in-stock-new';
105105
$suffix = '.html';
106106
$product->setUrlKey($renamedKey)->setData('save_rewrites_history', true)->save();
@@ -471,10 +471,10 @@ public function testUrlRewriteCleansCacheForCustomRewrites()
471471
$cacheId = $apiResponse['headers'][CacheIdCalculator::CACHE_ID_HEADER];
472472

473473
// Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
474-
$this->assertCacheMiss($query($customRequestPath), [CacheIdCalculator::CACHE_ID_HEADER => $cacheId]);
474+
$this->assertCacheMiss($query($customSecondRequestPath), [CacheIdCalculator::CACHE_ID_HEADER => $cacheId]);
475475

476476
// Verify we obtain a cache HIT the second time around for this X-Magento-Cache-Id
477-
$this->assertCacheHit($query($customRequestPath), [CacheIdCalculator::CACHE_ID_HEADER => $cacheId]);
477+
$this->assertCacheHit($query($customSecondRequestPath), [CacheIdCalculator::CACHE_ID_HEADER => $cacheId]);
478478
}
479479

480480
$urlRewriteResourceModel->delete($secondUrlRewriteModel);
@@ -485,7 +485,7 @@ public function testUrlRewriteCleansCacheForCustomRewrites()
485485
$query($customRequestPath),
486486
[CacheIdCalculator::CACHE_ID_HEADER => $cacheId]
487487
);
488-
$this->assertNull($apiResponse['route']);
488+
$this->assertNull($apiResponse['body']['route']);
489489
}
490490

491491
/**

0 commit comments

Comments
 (0)