Skip to content

Commit 12f8c0b

Browse files
committed
Merge branch 'MC-18450' of github.com:magento-honey-badgers/magento2ce into MC-18450
2 parents 7bfbc23 + 1b33135 commit 12f8c0b

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function testFilterProductsByDropDownCustomAttribute()
218218
products(filter:{
219219
$attributeCode: {eq: "{$optionValue}"}
220220
}
221-
sort:{relevance:DESC}
221+
222222
pageSize: 3
223223
currentPage: 1
224224
)
@@ -1493,12 +1493,12 @@ public function testSearchAndSortByRelevance()
14931493
}
14941494
QUERY;
14951495
$response = $this->graphQlQuery($query);
1496-
$this->assertEquals(4, $response['products']['total_count']);
1496+
$this->assertEquals(3, $response['products']['total_count']);
14971497
$this->assertNotEmpty($response['products']['filters'], 'Filters should have the Category layer');
14981498
$this->assertEquals('Colorful Category', $response['products']['filters'][0]['filter_items'][0]['label']);
1499-
$productsInResponse = ['ocean blue Shoes','Blue briefs','Navy Striped Shoes','Grey shorts'];
1500-
// phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
1501-
for ($i = 0; $i < count($response['products']['items']); $i++) {
1499+
$productsInResponse = ['Blue briefs','Navy Striped Shoes','Grey shorts'];
1500+
$count = count($response['products']['items']);
1501+
for ($i = 0; $i < $count; $i++) {
15021502
$this->assertEquals($productsInResponse[$i], $response['products']['items'][$i]['name']);
15031503
}
15041504
$this->assertCount(2, $response['products']['aggregations']);
@@ -1634,11 +1634,10 @@ public function testProductBasicFullTextSearchQuery()
16341634
$prod1 = $productRepository->get('blue_briefs');
16351635
$prod2 = $productRepository->get('grey_shorts');
16361636
$prod3 = $productRepository->get('navy-striped-shoes');
1637-
$prod4 = $productRepository->get('ocean-blue-shoes');
16381637
$response = $this->graphQlQuery($query);
1639-
$this->assertEquals(4, $response['products']['total_count']);
1638+
$this->assertEquals(3, $response['products']['total_count']);
16401639

1641-
$filteredProducts = [$prod1, $prod2, $prod3, $prod4];
1640+
$filteredProducts = [$prod1, $prod2, $prod3];
16421641
$productItemsInResponse = array_map(null, $response['products']['items'], $filteredProducts);
16431642
foreach ($productItemsInResponse as $itemIndex => $itemArray) {
16441643
$this->assertNotEmpty($itemArray);
@@ -1753,8 +1752,8 @@ public function testFilterWithinASpecificPriceRangeSortedByPriceDESC()
17531752
//verify that by default Price and category are the only layers available
17541753
$filterNames = ['Category', 'Price'];
17551754
$this->assertCount(2, $response['products']['filters'], 'Filter count does not match');
1756-
// phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
1757-
for ($i = 0; $i < count($response['products']['filters']); $i++) {
1755+
$productCount = count($response['products']['filters']);
1756+
for ($i = 0; $i < $productCount; $i++) {
17581757
$this->assertEquals($filterNames[$i], $response['products']['filters'][$i]['name']);
17591758
}
17601759
}
@@ -2031,8 +2030,8 @@ public function testInvalidPageSize()
20312030
private function assertProductItems(array $filteredProducts, array $actualResponse)
20322031
{
20332032
$productItemsInResponse = array_map(null, $actualResponse['products']['items'], $filteredProducts);
2034-
// phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
2035-
for ($itemIndex = 0; $itemIndex < count($filteredProducts); $itemIndex++) {
2033+
$count = count($filteredProducts);
2034+
for ($itemIndex = 0; $itemIndex < $count; $itemIndex++) {
20362035
$this->assertNotEmpty($productItemsInResponse[$itemIndex]);
20372036
$this->assertResponseFields(
20382037
$productItemsInResponse[$itemIndex][0],

dev/tests/integration/testsuite/Magento/Catalog/_files/products_for_relevance_sorting.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@
8181
->setAttributeSetId($defaultAttributeSet)
8282
->setStoreId(1)
8383
->setWebsiteIds([1])
84-
->setName('ocean blue Shoes')
85-
->setSku('ocean-blue-shoes')
84+
->setName('light green Shoes')
85+
->setSku('light-green-shoes')
8686
->setPrice(40)
8787
->setWeight(8)
88-
->setDescription('light blue shoes <b>one</b>')
89-
->setMetaTitle('light blue shoes meta title')
90-
->setMetaKeyword('light, blue , women, kids')
88+
->setDescription('green polka dots shoes <b>one</b>')
89+
->setMetaTitle('light green shoes meta title')
90+
->setMetaKeyword('light, green , women, kids')
9191
->setMetaDescription('shoes women kids meta description')
9292
->setStockData(['use_config_manage_stock' => 0])
9393
->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
@@ -100,7 +100,7 @@
100100
$productRepository->save($greyProduct);
101101

102102
$skus = ['green_socks', 'white_shorts','red_trousers','blue_briefs','grey_shorts',
103-
'navy-striped-shoes', 'ocean-blue-shoes'];
103+
'navy-striped-shoes', 'light-green-shoes'];
104104

105105
/** @var \Magento\Catalog\Api\CategoryLinkManagementInterface $categoryLinkManagement */
106106
$categoryLinkManagement = $objectManager->create(\Magento\Catalog\Api\CategoryLinkManagementInterface::class);

dev/tests/integration/testsuite/Magento/Catalog/_files/products_for_relevance_sorting_rollback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
2222
$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
2323
$productsToDelete = ['green_socks', 'white_shorts','red_trousers','blue_briefs',
24-
'grey_shorts', 'navy-striped-shoes','ocean-blue-shoes'];
24+
'grey_shorts', 'navy-striped-shoes','light-green-shoes'];
2525

2626
foreach ($productsToDelete as $sku) {
2727
try {

0 commit comments

Comments
 (0)