Skip to content

Commit 42aafc8

Browse files
32460: Fixed Web API test failures
1 parent 099c6fd commit 42aafc8

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,8 @@ public function testFilterByCategoryUrlPath(): void
207207
$response = $this->graphQlQuery($query);
208208
$this->assertEquals(2, $response['products']['total_count']);
209209
/** @var ProductRepositoryInterface $productRepository */
210-
$productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class);
211-
$product1 = $productRepository->get('simple');
212-
$product2 = $productRepository->get('simple-4');
210+
$product1 = $this->productRepository->get('simple');
211+
$product2 = $this->productRepository->get('simple-4');
213212
$filteredProducts = [$product2, $product1];
214213
$productItemsInResponse = array_map(null, $response['products']['items'], $filteredProducts);
215214
//phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
@@ -252,10 +251,9 @@ public function testFilterByMultipleCategoriesUrlPaths(): void
252251
$response = $this->graphQlQuery($query);
253252
$this->assertEquals(3, $response['products']['total_count']);
254253
/** @var ProductRepositoryInterface $productRepository */
255-
$productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class);
256-
$product1 = $productRepository->get('simple');
257-
$product2 = $productRepository->get('12345');
258-
$product3 = $productRepository->get('simple-4');
254+
$product1 = $this->productRepository->get('simple');
255+
$product2 = $this->productRepository->get('12345');
256+
$product3 = $this->productRepository->get('simple-4');
259257
$filteredProducts = [$product3, $product2, $product1];
260258
$productItemsInResponse = array_map(null, $response['products']['items'], $filteredProducts);
261259
//phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall

0 commit comments

Comments
 (0)