protected function setUp() { $translateInline = $this->getMock('\\Magento\\Framework\\Translate\\InlineInterface', [], [], '', false); $translateInline->expects($this->any())->method('isAllowed')->will($this->returnValue(false)); $context = $this->getMock('Magento\\Framework\\App\\Helper\\Context', ['getTranslateInline'], [], '', false); $context->expects($this->any())->method('getTranslateInline')->will($this->returnValue($translateInline)); $this->_string = new \Magento\Framework\Stdlib\StringUtils(); $this->_importFactory = $this->getMock('Magento\\ImportExport\\Model\\ImportFactory', [], [], '', false); $this->_resource = $this->getMock('Magento\\Framework\\App\\ResourceConnection', [], [], '', false); $this->_resourceHelper = $this->getMock('Magento\\ImportExport\\Model\\ResourceModel\\Helper', [], [], '', false); $this->_dataFactory = $this->getMock('Magento\\CustomerImportExport\\Model\\ResourceModel\\Import\\CustomerComposite\\DataFactory', [], [], '', false); $this->_customerFactory = $this->getMock('Magento\\CustomerImportExport\\Model\\Import\\CustomerFactory', [], [], '', false); $this->_addressFactory = $this->getMock('Magento\\CustomerImportExport\\Model\\Import\\AddressFactory', [], [], '', false); $this->errorFactory = $this->getMock('\\Magento\\ImportExport\\Model\\Import\\ErrorProcessing\\ProcessingErrorFactory', ['create'], [], '', false); $this->error = $this->getMock('\\Magento\\ImportExport\\Model\\Import\\ErrorProcessing\\ProcessingError', ['init'], [], '', false); $this->errorFactory->expects($this->any())->method('create')->will($this->returnValue($this->error)); $this->error->expects($this->any())->method('init')->will($this->returnValue(true)); $this->errorAggregator = $this->getMock('Magento\\ImportExport\\Model\\Import\\ErrorProcessing\\ProcessingErrorAggregator', ['hasToBeTerminated'], [$this->errorFactory], '', true); $this->_scopeConfigMock = $this->getMock('Magento\\Framework\\App\\Config\\ScopeConfigInterface'); }
/** * Test for method getErrorDescription * * @dataProvider errorDescriptionData */ public function testGetErrorDescription($data, $expectedValue) { $this->testInit($data); $result = $this->model->getErrorDescription(); $this->assertEquals($result, $expectedValue); }