Skip to content

Commit 316f0ac

Browse files
committed
Merge branch 'MC-15986-story' of github.com:magento-honey-badgers/magento2ce into MC-15986-story
2 parents e5a83c0 + 2a0536c commit 316f0ac

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
class CategoryListTest extends GraphQlAbstract
1818
{
19-
2019
/**
2120
* @magentoApiDataFixture Magento/Catalog/_files/categories.php
2221
* @dataProvider filterSingleCategoryDataProvider
@@ -39,7 +38,6 @@ public function testFilterSingleCategoryByField($field, $condition, $value, $exp
3938
}
4039
}
4140
QUERY;
42-
4341
$result = $this->graphQlQuery($query);
4442
$this->assertArrayNotHasKey('errors', $result);
4543
$this->assertCount(1, $result['categoryList']);
@@ -69,7 +67,6 @@ public function testFilterMultipleCategoriesByField($field, $condition, $value,
6967
}
7068
}
7169
QUERY;
72-
7370
$result = $this->graphQlQuery($query);
7471
$this->assertArrayNotHasKey('errors', $result);
7572
$this->assertCount(count($expectedResult), $result['categoryList']);
@@ -96,7 +93,6 @@ public function testFilterCategoryByMultipleFields()
9693
}
9794
}
9895
QUERY;
99-
10096
$result = $this->graphQlQuery($query);
10197
$this->assertArrayNotHasKey('errors', $result);
10298
$this->assertCount(3, $result['categoryList']);
@@ -121,7 +117,6 @@ public function testFilterWithInactiveCategory()
121117
}
122118
}
123119
QUERY;
124-
125120
$result = $this->graphQlQuery($query);
126121
$this->assertArrayNotHasKey('errors', $result);
127122
$this->assertCount(1, $result['categoryList']);
@@ -168,9 +163,7 @@ public function testQueryChildCategoriesWithProducts()
168163
}
169164
}
170165
QUERY;
171-
172166
$result = $this->graphQlQuery($query);
173-
$a = 3;
174167

175168
$this->assertArrayNotHasKey('errors', $result);
176169
$this->assertCount(1, $result['categoryList']);
@@ -234,7 +227,6 @@ public function testNoResultsFound()
234227
}
235228
}
236229
QUERY;
237-
238230
$result = $this->graphQlQuery($query);
239231
$this->assertArrayNotHasKey('errors', $result);
240232
$this->assertArrayHasKey('categoryList', $result);
@@ -261,7 +253,6 @@ public function testEmptyFiltersReturnRootCategory()
261253
}
262254
}
263255
QUERY;
264-
265256
$storeManager = Bootstrap::getObjectManager()->get(StoreManagerInterface::class);
266257
$storeRootCategoryId = $storeManager->getStore()->getRootCategoryId();
267258

@@ -292,7 +283,6 @@ public function testMinimumMatchQueryLength()
292283
}
293284
}
294285
QUERY;
295-
296286
$result = $this->graphQlQuery($query);
297287
$this->assertArrayNotHasKey('errors', $result);
298288
$this->assertArrayHasKey('categoryList', $result);
@@ -351,6 +341,7 @@ public function filterSingleCategoryDataProvider(): array
351341
}
352342

353343
/**
344+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
354345
* @return array
355346
*/
356347
public function filterMultipleCategoriesDataProvider(): array

dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/CategoryListCacheTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ public function testRequestCacheTagsForCategoryListOnMultipleIds(): void
9999
}
100100
}
101101
QUERY;
102+
//added the previous category in expected tags as it is cached
103+
$expectedCacheTags = ['cat_c','cat_c_' .'333', 'cat_c_' . $categoryId1, 'cat_c_' . $categoryId2, 'FPC'];
104+
102105
$response = $this->dispatchGraphQlGETRequest(['query' => $query]);
103106
$this->assertEquals('MISS', $response->getHeader('X-Magento-Cache-Debug')->getFieldValue());
104107
$actualCacheTags = explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue());
105-
$expectedCacheTags = ['cat_c','cat_c_' . $categoryId1, 'cat_c_' . $categoryId2, 'FPC'];
106108
$this->assertEquals($expectedCacheTags, $actualCacheTags);
107109
}
108110

@@ -127,7 +129,8 @@ public function testSecondRequestIsServedFromCacheOnMultipleIds()
127129
}
128130
}
129131
QUERY;
130-
$expectedCacheTags = ['cat_c','cat_c_' . $categoryId1, 'cat_c_' . $categoryId2, 'FPC'];
132+
//added the previous category in expected tags as it is cached
133+
$expectedCacheTags = ['cat_c','cat_c_' .'333', 'cat_c_' . $categoryId1, 'cat_c_' . $categoryId2, 'FPC'];
131134

132135
$response = $this->dispatchGraphQlGETRequest(['query' => $query]);
133136
$this->assertEquals('MISS', $response->getHeader('X-Magento-Cache-Debug')->getFieldValue());

0 commit comments

Comments
 (0)