Skip to content

Commit 9ecbf0d

Browse files
author
Artem Kirkor
committed
Issue magento#35676 Add Unit tests
1 parent df339b5 commit 9ecbf0d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

app/code/Magento/ImportExport/Test/Unit/Model/Import/Entity/AbstractTest.php

+16-1
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,29 @@ public function testValidateDataColumnNameWithWhitespaces()
126126
);
127127
}
128128

129+
/**
130+
* Test for method validateData()
131+
*
132+
* @covers \Magento\ImportExport\Model\Import\Entity\AbstractEntity::validateData
133+
*/
134+
public function testValidateColumnName()
135+
{
136+
$this->_createSourceAdapterMock(['Test_1']);
137+
$errorAggregator = $this->_model->validateData();
138+
$this->assertArrayNotHasKey(
139+
AbstractEntity::ERROR_CODE_COLUMN_NAME_INVALID,
140+
$errorAggregator->getRowsGroupedByErrorCode()
141+
);
142+
}
143+
129144
/**
130145
* Test for method validateData()
131146
*
132147
* @covers \Magento\ImportExport\Model\Import\Entity\AbstractEntity::validateData
133148
*/
134149
public function testValidateDataAttributeNames()
135150
{
136-
$this->_createSourceAdapterMock(['_test1']);
151+
$this->_createSourceAdapterMock(['test.1', '@test']);
137152
$errorAggregator = $this->_model->validateData();
138153
$this->assertArrayHasKey(
139154
AbstractEntity::ERROR_CODE_COLUMN_NAME_INVALID,

0 commit comments

Comments
 (0)