public function testPrepareAttributesWithDefaultValueForSave() { $rowData = ['_attribute_set' => 'attributeSetName', 'boolean_attribute' => 'Yes']; $result = $this->simpleType->prepareAttributesWithDefaultValueForSave($rowData); $this->assertEquals(['boolean_attribute' => 1], $result); }
/** * Prepare attributes with default value for save. * * @param array $rowData * @param bool $withDefaultValue * @return array */ public function prepareAttributesWithDefaultValueForSave(array $rowData, $withDefaultValue = true) { $resultAttrs = parent::prepareAttributesWithDefaultValueForSave($rowData, $withDefaultValue); $resultAttrs = array_merge($resultAttrs, $this->setWeightVirtualProduct($rowData)); return $resultAttrs; }