@@ -225,16 +225,16 @@ public function testPersistTokenCountField()
225225 $ product ->setTokenPiecesCount ('t e s t ' );
226226 $ manager ->persist ($ product );
227227 $ manager ->commit ();
228-
228+ $ repo = $ manager -> getRepository ( ' AcmeBarBundle:Product ' );
229229 // Analyzer is whitespace, so there are four tokens.
230230 $ search = new Search ();
231231 $ search ->addQuery (new TermQuery ('pieces_count.count ' , '4 ' ));
232- $ this ->assertEquals (1 , $ manager -> execute ([ ' AcmeBarBundle:Product ' ], $ search )->count ());
232+ $ this ->assertEquals (1 , $ repo -> findDocuments ( $ search )->count ());
233233
234234 // Test with invalid count.
235235 $ search = new Search ();
236236 $ search ->addQuery (new TermQuery ('pieces_count.count ' , '6 ' ));
237- $ this ->assertEquals (0 , $ manager -> execute ([ ' AcmeBarBundle:Product ' ], $ search )->count ());
237+ $ this ->assertEquals (0 , $ repo -> findDocuments ( $ search )->count ());
238238 }
239239
240240 /**
@@ -277,16 +277,16 @@ public function testGetRepositoryException()
277277 }
278278
279279 /**
280- * Test if execute () works with multiple types.
280+ * Test if search () works with multiple types.
281281 */
282282 public function testExecuteQueryOnMultipleTypes ()
283283 {
284- $ result = $ this ->getManager ('foo ' )->execute (
285- ['AcmeBarBundle:Product ' , 'AcmeFooBundle:Customer ' ],
286- new Search ()
284+ $ result = $ this ->getManager ('foo ' )->search (
285+ ['product ' , 'customer ' ],
286+ ( new Search ())-> toArray ()
287287 );
288288
289- $ this ->assertCount (5 , $ result );
289+ $ this ->assertCount (5 , $ result[ ' hits ' ][ ' hits ' ] );
290290 }
291291
292292 /**
@@ -328,26 +328,28 @@ public function testParseResultsWithDifferentResultTypes()
328328 $ repo = $ fooManager ->getRepository ('AcmeBarBundle:Product ' );
329329 $ search = $ repo ->createSearch ();
330330 $ search ->addQuery (new MatchAllQuery ());
331- $ products = $ repo ->execute ($ search, ' array ' );
331+ $ products = $ repo ->findArray ($ search );
332332 $ this ->assertArrayHasKey (0 , $ products );
333333
334334 $ repo = $ defaultManager ->getRepository ('AcmeBarBundle:Product ' );
335335 $ search = $ repo ->createSearch ();
336336 $ search ->addQuery (new MatchAllQuery ());
337- $ products = $ repo ->execute ($ search, ' array ' );
337+ $ products = $ repo ->findArray ($ search );
338338 $ this ->assertArrayNotHasKey (0 , $ products );
339339
340340 $ repo = $ fooManager ->getRepository ('AcmeBarBundle:Product ' );
341341 $ search = $ repo ->createSearch ();
342342 $ search ->addQuery (new MatchAllQuery ());
343- $ products = $ repo ->execute ($ search, ' raw_iterator ' );
343+ $ products = $ repo ->findRaw ($ search );
344344 $ this ->assertInstanceOf ('ONGR\ElasticsearchBundle\Result\RawIterator ' , $ products );
345345 }
346346
347347 /**
348348 * Tests exception that is thrown by parseResults()
349349 * when a bad result type is provided
350350 *
351+ * @deprecated Function will be removed in 3.0
352+ *
351353 * @expectedException \Exception
352354 */
353355 public function testParseResultsException ()
0 commit comments