/** * @param bool $scheduled * @dataProvider runDataProvider */ public function testReindexList($scheduled) { $ids = [1]; if ($scheduled) { $this->_indexerRegistryMock->expects($this->once())->method('get')->with(\Magento\Catalog\Model\Indexer\Category\Product::INDEXER_ID)->willReturnSelf(); $this->_indexerRegistryMock->expects($this->once())->method('isScheduled')->willReturn($scheduled); $this->assertEquals(null, $this->model->reindexList($ids)); } else { $this->_indexerRegistryMock->expects($this->exactly(2))->method('get')->with(\Magento\Catalog\Model\Indexer\Category\Product::INDEXER_ID)->willReturnSelf(); $this->_indexerRegistryMock->expects($this->once())->method('isScheduled')->willReturn($scheduled); $this->_indexerRegistryMock->expects($this->once())->method('reindexList')->with($ids)->willReturnSelf(); $this->assertEquals(null, $this->model->reindexList($ids)); } }
/** * Test isIndexerScheduled() */ public function testIsIndexerScheduled() { $this->_indexerRegistryMock->expects($this->once())->method('get')->with(\Magento\Indexer\Test\Unit\Model\Indexer\AbstractProcessorStub::INDEXER_ID)->willReturnSelf(); $this->_indexerRegistryMock->expects($this->once())->method('isScheduled')->willReturn(false); $this->model->isIndexerScheduled(); }
/** * Test isIndexerScheduled() */ public function testIsIndexerScheduled() { $this->_indexerRegistryMock->expects($this->once())->method('get')->with(\Magento\Catalog\Model\Indexer\Category\Product::INDEXER_ID)->willReturnSelf(); $this->_indexerRegistryMock->expects($this->once())->method('isScheduled')->willReturn(false); $this->model->isIndexerScheduled(); }