public function testClearChangelogDisabled() { $this->stateMock->expects($this->once())->method('getMode')->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); $this->stateMock->expects($this->never())->method('getVersionId'); $this->changelogMock->expects($this->never())->method('clear'); $this->loadView(); $this->model->clearChangelog(); }
/** * Test deleting changelog table */ public function testDeleteCl() { $this->_changelogMock->expects($this->any())->method('getName')->will($this->returnValue('catalog_product_flat_cl')); $this->_connectionMock->expects($this->once())->method('getTables')->with('catalog_product_flat_%')->will($this->returnValue(['catalog_product_flat_cl'])); $this->_connectionMock->expects($this->never())->method('dropTable'); $this->_resourceMock->expects($this->once())->method('getConnection')->with('write')->will($this->returnValue($this->_connectionMock)); $this->_setStoreManagerExpectedStores([1]); $this->_model->deleteAbandonedStoreFlatTables(); }