Ejemplo n.º 1
0
 /**
  * Retrieve array of EAV type indexers
  *
  * @return \Magento\Catalog\Model\Resource\Product\Indexer\Eav\AbstractEav[]
  */
 public function getIndexers()
 {
     if ($this->_types === null) {
         $this->_types = ['source' => $this->_eavSourceFactory->create(), 'decimal' => $this->_eavDecimalFactory->create()];
     }
     return $this->_types;
 }
Ejemplo n.º 2
0
 /**
  * Retrieve array of EAV type indexers
  *
  * @return \Magento\Catalog\Model\Resource\Product\Indexer\Eav\AbstractEav[]
  */
 public function getIndexers()
 {
     if (is_null($this->_types)) {
         $this->_types = array('source' => $this->_eavSourceFactory->create(), 'decimal' => $this->_eavDecimalFactory->create());
     }
     return $this->_types;
 }
 public function testReindexWithNotNullArgumentExecutesReindexEntities()
 {
     $ids = [1, 2, 3];
     $eavSource = $this->getMockBuilder('Magento\\Catalog\\Model\\Resource\\Product\\Indexer\\Eav\\Source')->disableOriginalConstructor()->getMock();
     $eavDecimal = $this->getMockBuilder('Magento\\Catalog\\Model\\Resource\\Product\\Indexer\\Eav\\Decimal')->disableOriginalConstructor()->getMock();
     $eavDecimal->expects($this->once())->method('reindexEntities')->with($ids);
     $eavSource->expects($this->once())->method('reindexEntities')->with($ids);
     $this->_eavSourceFactoryMock->expects($this->once())->method('create')->will($this->returnValue($eavSource));
     $this->_eavDecimalFactoryMock->expects($this->once())->method('create')->will($this->returnValue($eavDecimal));
     $this->_model->reindex($ids);
 }