24 $this->_indexerRegistryMock = $this->createPartialMock(
26 [
'isScheduled',
'get',
'reindexRow',
'reindexList',
'reindexAll',
'invalidate']
28 $this->model = new \Magento\Indexer\Test\Unit\Model\Indexer\AbstractProcessorStub(
29 $this->_indexerRegistryMock
35 $this->_indexerRegistryMock->expects($this->once())->method(
'get')->with(
38 $this->model->getIndexer();
43 $this->_indexerRegistryMock->expects($this->once())->method(
'get')->with(
46 $this->_indexerRegistryMock->expects($this->once())->method(
'reindexAll')->willReturnSelf();
47 $this->model->reindexAll();
52 $this->_indexerRegistryMock->expects($this->once())->method(
'get')->with(
55 $this->_indexerRegistryMock->expects($this->once())->method(
'invalidate')->willReturnSelf();
56 $this->model->markIndexerAsInvalid();
61 $this->assertEquals(self::INDEXER_ID, $this->model->getIndexerId());
72 $this->_indexerRegistryMock->expects($this->once())->method(
'get')->with(
75 $this->_indexerRegistryMock->expects($this->once())->method(
'isScheduled')->willReturn($scheduled);
76 $this->assertEquals(
null, $this->model->reindexRow(
$id));
78 $this->_indexerRegistryMock->expects($this->exactly(2))->method(
'get')->with(
81 $this->_indexerRegistryMock->expects($this->once())->method(
'isScheduled')->willReturn($scheduled);
82 $this->_indexerRegistryMock->expects($this->once())->method(
'reindexRow')->with(
$id)->willReturnSelf();
83 $this->assertEquals(
null, $this->model->reindexRow(
$id));
95 $this->_indexerRegistryMock->expects($this->once())->method(
'get')->with(
98 $this->_indexerRegistryMock->expects($this->once())->method(
'isScheduled')->willReturn($scheduled);
99 $this->assertEquals(
null, $this->model->reindexList($ids));
101 $this->_indexerRegistryMock->expects($this->exactly(2))->method(
'get')->with(
104 $this->_indexerRegistryMock->expects($this->once())->method(
'isScheduled')->willReturn($scheduled);
105 $this->_indexerRegistryMock->expects($this->once())->method(
'reindexList')->with($ids)->willReturnSelf();
106 $this->assertEquals(
null, $this->model->reindexList($ids));
126 $this->_indexerRegistryMock->expects($this->once())->method(
'get')->with(
129 $this->_indexerRegistryMock->expects($this->once())->method(
'isScheduled')->willReturn(
false);
130 $this->model->isIndexerScheduled();
testReindexList($scheduled)
testReindexRow($scheduled)
testMarkIndexerAsInvalid()