@@ -207,9 +207,8 @@ public function testFilterByCategoryUrlPath(): void
207
207
$ response = $ this ->graphQlQuery ($ query );
208
208
$ this ->assertEquals (2 , $ response ['products ' ]['total_count ' ]);
209
209
/** @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 ' );
213
212
$ filteredProducts = [$ product2 , $ product1 ];
214
213
$ productItemsInResponse = array_map (null , $ response ['products ' ]['items ' ], $ filteredProducts );
215
214
//phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
@@ -252,10 +251,9 @@ public function testFilterByMultipleCategoriesUrlPaths(): void
252
251
$ response = $ this ->graphQlQuery ($ query );
253
252
$ this ->assertEquals (3 , $ response ['products ' ]['total_count ' ]);
254
253
/** @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 ' );
259
257
$ filteredProducts = [$ product3 , $ product2 , $ product1 ];
260
258
$ productItemsInResponse = array_map (null , $ response ['products ' ]['items ' ], $ filteredProducts );
261
259
//phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
0 commit comments