Esempio n. 1
0
 /**
  * @param array $dbVersionErrors
  *
  * @dataProvider aroundDispatchExceptionDataProvider
  * @expectedException \Magento\Framework\Module\Exception
  * @expectedExceptionMessage Please update 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);
 }
 /**
  * @param array $schemaValueMap
  * @param array $dataValueMap
  *
  * @dataProvider aroundDispatchExceptionDataProvider
  * @expectedException \Magento\Framework\Module\Exception
  * @expectedExceptionMessage Looks like database is outdated. Please, use setup tool to perform update
  */
 public function testAroundDispatchException(array $schemaValueMap, array $dataValueMap)
 {
     $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->moduleManager->expects($this->any())->method('isDbSchemaUpToDate')->will($this->returnValueMap($schemaValueMap));
     $this->moduleManager->expects($this->any())->method('isDbDataUpToDate')->will($this->returnValueMap($dataValueMap));
     $this->_model->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock);
 }