コード例 #1
0
 /**
  * Test whether correct methods are invoked in case of custom behaviour for each row in action column
  */
 public function testImportDataWithCustomBehaviour()
 {
     $this->_model = $this->_getModelMockForTestImportDataWithCustomBehaviour();
     $this->_model->setParameters(['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_CUSTOM]);
     // validation in validateSaveCustomerEntities and validateDeleteCustomerEntities
     $this->_model->importData();
 }
コード例 #2
0
 public function testValidateEmailForDeleteBehavior()
 {
     $this->_customerData[Customer::COLUMN_EMAIL] = '*****@*****.**';
     $this->_model->setParameters(['behavior' => Import::BEHAVIOR_DELETE]);
     $this->_model->validateRow($this->_customerData, 0);
     $this->assertGreaterThan(0, $this->_model->getErrorsCount());
     $this->assertArrayHasKey(Customer::ERROR_CUSTOMER_NOT_FOUND, $this->_model->getErrorMessages());
 }
コード例 #3
0
 public function testValidateEmailForDeleteBehavior()
 {
     $this->_model->getErrorAggregator()->clear();
     $this->_customerData[Customer::COLUMN_EMAIL] = '*****@*****.**';
     $this->_model->setParameters(['behavior' => Import::BEHAVIOR_DELETE]);
     $this->_model->validateRow($this->_customerData, 0);
     $this->assertGreaterThan(0, $this->_model->getErrorAggregator()->getErrorsCount());
     $this->assertNotEmpty($this->_model->getErrorAggregator()->getErrorsByCode([Customer::ERROR_CUSTOMER_NOT_FOUND]));
 }
コード例 #4
0
ファイル: CustomerComposite.php プロジェクト: aiesh/magento2
 /**
  * Returns number of checked entities
  *
  * @return int
  */
 public function getProcessedEntitiesCount()
 {
     return $this->_customerEntity->getProcessedEntitiesCount() + $this->_addressEntity->getProcessedEntitiesCount();
 }
コード例 #5
0
 /**
  * @inheritDoc
  */
 public function getValidColumnNames()
 {
     $this->validColumnNames = array_merge($this->validColumnNames, $this->_customerAttributes, $this->_addressAttributes, $this->_customerEntity->getValidColumnNames());
     return $this->validColumnNames;
 }