@@ -43,23 +43,22 @@ public function saveProductShouldUpdateSolrIndex()
4343 {
4444 $ this ->setUpFreshIndex ();
4545
46- $ this ->setCurrentStore (0 );
47- $ this ->adminSession ();
46+ $ this ->assertCount (0 , $ this ->searchInStore (1 , 'SUPERDUPER ' )->documents ());
4847 $ productId = 21001 ;
48+ $ this ->setCurrentStore (0 );
4949 $ product = Mage::getModel ('catalog/product ' )->load ($ productId );
5050 $ product ->setData ('name ' , 'SUPERDUPER ' );
5151 $ product ->save ();
52- $ searchResponse = $ this ->searchFor ( 'SUPERDUPER ' );
52+ $ searchResponse = $ this ->searchInStore ( 1 , 'SUPERDUPER ' );
5353 $ this ->assertCount (1 , $ searchResponse ->documents ());
5454 }
5555
5656 /**
5757 * @param $queryText
5858 * @return \IntegerNet\Solr\Resource\SolrResponse
5959 */
60- public function searchFor ( $ queryText )
60+ public function searchInStore ( $ storeId , $ queryText )
6161 {
62- $ storeId = 1 ;
6362 $ queryStub = $ this ->getMockBuilder (\IntegerNet \Solr \Implementor \HasUserQuery::class)
6463 ->getMockForAbstractClass ();
6564 $ queryStub ->method ('getUserQueryText ' )->willReturn ($ queryText );
@@ -79,7 +78,5 @@ public function searchFor($queryText)
7978 private function setUpFreshIndex ()
8079 {
8180 Mage::getModel ('integernet_solr/indexer ' )->reindexAll ();
82- $ indexProcess = Mage::getModel ('index/process ' )->load ('integernet_solr ' , 'indexer_code ' );
83- $ indexProcess ->setMode (Mage_Index_Model_Process::MODE_REAL_TIME )->save ();
8481 }
8582}
0 commit comments