/** * @param array $dbVersionErrors * * @dataProvider aroundDispatchExceptionDataProvider * @expectedException \Magento\Framework\Exception\LocalizedException * @expectedExceptionMessage Please upgrade your database: */ public function testAroundDispatchException(array $dbVersionErrors) { $this->_cacheMock->expects($this->once())->method('load')->with('db_is_up_to_date')->will($this->returnValue(false)); $this->_cacheMock->expects($this->never())->method('save'); $this->dbVersionInfoMock->expects($this->any())->method('getDbVersionErrors')->will($this->returnValue($dbVersionErrors)); $this->_model->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock); }
public function testExecuteNotInstalled() { $this->deploymentConfig->expects($this->once())->method('isAvailable')->will($this->returnValue(false)); $this->dbVersionInfo->expects($this->never())->method('getDbVersionErrors'); $tester = new CommandTester($this->command); $tester->execute([]); $this->assertStringMatchesFormat('No information is available: the Magento application is not installed.%w', $tester->getDisplay()); }
public function testUpdateDataNoUpdates() { $this->_dbVersionInfo->expects($this->once())->method('isDataUpToDate')->with('Test_Module', 'catalog_setup')->will($this->returnValue(true)); $this->_factoryMock->expects($this->never())->method('create'); $this->_model->updateData(); }