@@ -186,7 +186,7 @@ public function testStoreCannotQueryOnInvalidResponse()
186186 $ this ->expectException (ClientException::class);
187187 $ this ->expectExceptionMessage ('HTTP 400 returned for "http://127.0.0.1:7700/indexes/test/search". ' );
188188 $ this ->expectExceptionCode (400 );
189- $ store ->query (new Vector ([0.1 , 0.2 , 0.3 ]));
189+ iterator_to_array ( $ store ->query (new Vector ([0.1 , 0.2 , 0.3 ]) ));
190190 }
191191
192192 public function testStoreCanQuery ()
@@ -328,7 +328,7 @@ public function testQueryUsesDefaultSemanticRatio()
328328 $ store = new Store ($ httpClient , 'http://localhost:7700 ' , 'key ' , 'index ' , semanticRatio: 0.7 );
329329
330330 $ vector = new Vector ([0.1 , 0.2 , 0.3 ]);
331- $ store ->query ($ vector );
331+ iterator_to_array ( $ store ->query ($ vector) );
332332
333333 $ request = $ httpClient ->getRequestsCount () > 0 ? $ responses [0 ]->getRequestOptions () : null ;
334334 $ this ->assertNotNull ($ request );
@@ -348,8 +348,7 @@ public function testQueryCanOverrideSemanticRatio()
348348 $ httpClient = new MockHttpClient ($ responses );
349349 $ store = new Store ($ httpClient , 'http://localhost:7700 ' , 'key ' , 'index ' , semanticRatio: 0.5 );
350350
351- $ vector = new Vector ([0.1 , 0.2 , 0.3 ]);
352- $ store ->query ($ vector , ['semanticRatio ' => 0.2 ]);
351+ iterator_to_array ($ store ->query (new Vector ([0.1 , 0.2 , 0.3 ]), ['semanticRatio ' => 0.2 ]));
353352
354353 $ request = $ responses [0 ]->getRequestOptions ();
355354 $ body = json_decode ($ request ['body ' ], true );
@@ -366,7 +365,7 @@ public function testQueryThrowsExceptionForInvalidSemanticRatioOption()
366365 $ store = new Store ($ httpClient , 'http://localhost:7700 ' , 'key ' , 'index ' );
367366
368367 $ vector = new Vector ([0.1 , 0.2 , 0.3 ]);
369- $ store ->query ($ vector , ['semanticRatio ' => 2.0 ]);
368+ iterator_to_array ( $ store ->query ($ vector , ['semanticRatio ' => 2.0 ]) );
370369 }
371370
372371 public function testQueryWithPureKeywordSearch ()
@@ -414,7 +413,7 @@ public function testQueryWithBalancedHybridSearch()
414413 $ store = new Store ($ httpClient , 'http://localhost:7700 ' , 'key ' , 'index ' , semanticRatio: 0.5 );
415414
416415 $ vector = new Vector ([0.1 , 0.2 , 0.3 ]);
417- $ store ->query ($ vector );
416+ iterator_to_array ( $ store ->query ($ vector) );
418417
419418 $ request = $ responses [0 ]->getRequestOptions ();
420419 $ body = json_decode ($ request ['body ' ], true );
0 commit comments