コード例 #1
0
 public function testResetAllIndexes()
 {
     $indexName = 'index1';
     $indexConfig = new IndexConfig($indexName, array(), array());
     $this->mockIndex($indexName, $indexConfig);
     $this->configManager->expects($this->once())->method('getIndexNames')->will($this->returnValue(array($indexName)));
     $this->dispatcherExpects(array(array(IndexResetEvent::PRE_INDEX_RESET, $this->isInstanceOf('FOS\\ElasticaBundle\\Event\\IndexResetEvent')), array(IndexResetEvent::POST_INDEX_RESET, $this->isInstanceOf('FOS\\ElasticaBundle\\Event\\IndexResetEvent'))));
     $this->elasticaClient->expects($this->exactly(2))->method('request')->withConsecutive(array('index1/', 'DELETE'), array('index1/', 'PUT', array(), array()));
     $this->resetter->resetAllIndexes();
 }
コード例 #2
0
 public function testResetAllIndexes()
 {
     $this->configManager->expects($this->once())->method('getIndexNames')->will($this->returnValue(array('index1')));
     $this->configManager->expects($this->once())->method('getIndexConfiguration')->with('index1')->will($this->returnValue(new IndexConfig('index1', array(), array())));
     $this->indexManager->expects($this->once())->method('getIndex')->with('index1')->will($this->returnValue());
     /*$this->indexConfigsByName['foo']['index']->expects($this->once())
                 ->method('create')
                 ->with($this->indexConfigsByName['foo']['config'], true);
     
             $this->indexConfigsByName['bar']['index']->expects($this->once())
                 ->method('create')
                 ->with($this->indexConfigsByName['bar']['config'], true);
     
             $resetter = new Resetter($this->indexConfigsByName);*/
     $this->resetter->resetAllIndexes();
 }