コード例 #1
0
 public function testReindexList()
 {
     $ids = [1];
     $stateMock = $this->getMock('\\Magento\\Indexer\\Model\\Indexer\\State', ['load', 'save'], [], '', false);
     $actionMock = $this->getMock('Magento\\Framework\\Indexer\\ActionInterface', ['executeFull', 'executeList', 'executeRow'], [], '', false);
     $this->actionFactoryMock->expects($this->once())->method('create')->will($this->returnValue($actionMock));
     $this->stateFactoryMock->expects($this->once())->method('create')->will($this->returnValue($stateMock));
     $stateMock->expects($this->once())->method('save')->will($this->returnSelf());
     $actionMock->expects($this->once())->method('executeList')->with($ids)->will($this->returnSelf());
     $this->model->reindexList($ids);
 }