Skip to content

Commit 42d5e70

Browse files
committed
MAGE-1245 Add cache tag assertion
1 parent 7333144 commit 42d5e70

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

Test/Integration/Category/CategoryCacheTest.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class CategoryCacheTest extends \Magento\TestFramework\TestCase\AbstractControll
1717
public static function getCategoryProvider(): array
1818
{
1919
return [
20-
['categoryId' => 20, 'name' => 'Ladies'],
21-
['categoryId' => 21, 'name' => 'Ladies Tops'],
20+
['categoryId' => 20, 'name' => 'Women'],
21+
['categoryId' => 21, 'name' => 'Women > Tops'],
2222
];
2323
}
2424

@@ -48,6 +48,11 @@ public function testCategoryPlpMiss(int $categoryId, string $name): void
4848
$response->getHeader('X-Magento-Cache-Debug')->getFieldValue(),
4949
"expected MISS on category {$name} id {$categoryId}"
5050
);
51+
$this->assertContains(
52+
'FPC',
53+
explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue()),
54+
"expected FPC tag on category {$name} id {$categoryId}"
55+
);
5156
}
5257

5358
protected function resetResponse(): void
@@ -111,17 +116,6 @@ function (ResponseHttp $response, $name, $value, $replace)
111116
$this->assertEquals(200, $response->getHttpResponseCode(), 'Request failed');
112117
}
113118

114-
public function xtestCategoryPlpHit(int $categoryId, string $name): void
115-
{
116-
$this->dispatch("catalog/category/view/id/{$categoryId}");
117-
$response = $this->getResponse();
118-
$this->assertEquals(
119-
'HIT',
120-
$response->getHeader('X-Magento-Cache-Debug')->getFieldValue(),
121-
"expected HIT on category {$name} id {$categoryId}"
122-
);
123-
}
124-
125119
public function testFullPageCacheAvailable(): void
126120
{
127121
$types = $this->cacheManager->getAvailableTypes();

0 commit comments

Comments
 (0)