Esempio n. 1
0
 /**
  * Test whether correct methods are invoked in case of custom behaviour for each row in action column
  *
  * @covers Mage_ImportExport_Model_Import_Entity_Eav_Customer::_importData
  */
 public function testImportDataWithCustomBehaviour()
 {
     $this->_model = $this->_getModelMockForTestImportDataWithCustomBehaviour();
     $this->_model->setParameters(array('behavior' => Mage_ImportExport_Model_Import::BEHAVIOR_CUSTOM));
     // validation in validateSaveCustomerEntities and validateDeleteCustomerEntities
     $this->_model->importData();
 }
Esempio n. 2
0
 /**
  * Import data rows
  *
  * @return boolean
  */
 protected function _importData()
 {
     $result = $this->_customerEntity->importData();
     if ($this->getBehavior() != Mage_ImportExport_Model_Import::BEHAVIOR_DELETE) {
         return $result && $this->_addressEntity->importData();
     }
     return $result;
 }
Esempio n. 3
0
 /**
  * Test importData() method (delete behavior)
  *
  * @covers Mage_ImportExport_Model_Import_Entity_Eav_Customer::_importData
  * @covers Mage_ImportExport_Model_Import_Entity_Eav_Customer::_deleteCustomers
  *
  * @magentoDataFixture Mage/ImportExport/_files/customers.php
  */
 public function testDeleteData()
 {
     $source = new Mage_ImportExport_Model_Import_Source_Csv(__DIR__ . '/_files/customers_to_import.csv');
     /** @var $customerCollection Mage_Customer_Model_Resource_Customer_Collection */
     $customerCollection = Mage::getResourceModel('Mage_Customer_Model_Resource_Customer_Collection');
     $this->assertEquals(3, $customerCollection->count(), 'Count of existing customers are invalid');
     $this->_model->setParameters(array('behavior' => Mage_ImportExport_Model_Import::BEHAVIOR_DELETE))->setSource($source)->isDataValid();
     $this->_model->importData();
     $customerCollection->resetData();
     $customerCollection->clear();
     $this->assertEmpty($customerCollection->count(), 'Customers were not imported');
 }