File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -919,7 +919,8 @@ public function deleteInactiveProducts($storeId): void
919
919
'query ' => '' ,
920
920
'attributesToRetrieve ' => [AlgoliaHelper::ALGOLIA_API_OBJECT_ID ],
921
921
];
922
- foreach ($ client ->browseObjects ($ indexName , $ browseOptions ) as $ hit ) {
922
+ $ hits = $ client ->browseObjects ($ indexName , $ browseOptions );
923
+ foreach ($ hits as $ hit ) {
923
924
$ objectIds [] = $ hit [AlgoliaHelper::ALGOLIA_API_OBJECT_ID ];
924
925
$ counter ++;
925
926
if ($ counter === 1000 ) {
Original file line number Diff line number Diff line change @@ -36,11 +36,12 @@ public function testExcludedPages()
36
36
$ indexer = $ this ->getObjectManager ()->create (Page::class);
37
37
$ this ->processTest ($ indexer , 'pages ' , $ this ->assertValues ->expectedExcludePages );
38
38
39
- $ results = $ this ->algoliaHelper ->query ($ this ->indexPrefix . 'default_pages ' , '' , []);
39
+ $ response = $ this ->algoliaHelper ->query ($ this ->indexPrefix . 'default_pages ' , '' , []);
40
+ $ hits = reset ($ response ['results ' ])['hits ' ];
40
41
41
42
$ noRoutePageExists = false ;
42
43
$ homePageExists = false ;
43
- foreach ($ results [ ' hits ' ] as $ hit ) {
44
+ foreach ($ hits as $ hit ) {
44
45
if ($ hit ['slug ' ] === 'no-route ' ) {
45
46
$ noRoutePageExists = true ;
46
47
@@ -65,8 +66,9 @@ public function testDefaultIndexableAttributes()
65
66
66
67
$ this ->algoliaHelper ->waitLastTask ();
67
68
68
- $ results = $ this ->algoliaHelper ->query ($ this ->indexPrefix . 'default_pages ' , '' , ['hitsPerPage ' => 1 ]);
69
- $ hit = reset ($ results ['hits ' ]);
69
+ $ response = $ this ->algoliaHelper ->query ($ this ->indexPrefix . 'default_pages ' , '' , ['hitsPerPage ' => 1 ]);
70
+ $ hits = reset ($ response ['results ' ]);
71
+ $ hit = reset ($ hits ['hits ' ]);
70
72
71
73
$ defaultAttributes = [
72
74
'objectID ' ,
You can’t perform that action at this time.
0 commit comments