/** * 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 Mage_ImportExport_Model_Import_SourceAbstract|PHPUnit_Framework_MockObject_MockObject */ protected function _createSourceAdapterMock(array $columns) { /** @var $source Mage_ImportExport_Model_Import_SourceAbstract|PHPUnit_Framework_MockObject_MockObject */ $source = $this->getMockForAbstractClass('Mage_ImportExport_Model_Import_SourceAbstract', array(), '', false, true, true, array('getColNames')); $source->expects($this->any())->method('getColNames')->will($this->returnValue($columns)); $this->_model->setSource($source); return $source; }
/** * Constructor * * @param array $data */ public function __construct(array $data = array()) { parent::__construct($data); $this->_websiteManager = isset($data['website_manager']) ? $data['website_manager'] : Mage::app(); $this->_storeManager = isset($data['store_manager']) ? $data['store_manager'] : Mage::app(); $this->_attributeCollection = isset($data['attribute_collection']) ? $data['attribute_collection'] : Mage::getResourceModel(static::ATTRIBUTE_COLLECTION_NAME); if (isset($data['entity_type_id'])) { $this->_entityTypeId = $data['entity_type_id']; } else { $this->_entityTypeId = Mage::getSingleton('Mage_Eav_Model_Config')->getEntityType($this->getEntityTypeCode())->getEntityTypeId(); } }
/** * Prepare validated row data for saving to db * * @param array $rowData * @return array */ protected function _prepareRowForDb(array $rowData) { $rowData['_scope'] = $this->_getRowScope($rowData); $rowData[Mage_ImportExport_Model_Import_Entity_Eav_Customer_Address::COLUMN_WEBSITE] = $this->_currentWebsiteCode; $rowData[Mage_ImportExport_Model_Import_Entity_Eav_Customer_Address::COLUMN_EMAIL] = $this->_currentEmail; $rowData[Mage_ImportExport_Model_Import_Entity_Eav_Customer_Address::COLUMN_ADDRESS_ID] = null; return parent::_prepareRowForDb($rowData); }