/** * Create source adapter mock and set it into model object which tested in this class * * @param array $columns value which will be returned by method getColNames() * @return \Magento\ImportExport\Model\Import\AbstractSource|\PHPUnit_Framework_MockObject_MockObject */ protected function _createSourceAdapterMock(array $columns) { /** @var $source \Magento\ImportExport\Model\Import\AbstractSource|\PHPUnit_Framework_MockObject_MockObject */ $source = $this->getMockForAbstractClass('Magento\\ImportExport\\Model\\Import\\AbstractSource', [], '', false, true, true, ['getColNames']); $source->expects($this->any())->method('getColNames')->will($this->returnValue($columns)); $this->_model->setSource($source); return $source; }