/** * @dataProvider prepareAttributesWithDefaultValueForSaveDataProvider */ public function testPrepareAttributesWithDefaultValueForSave($rowData, $withDefaultValue, $expectedAttributes) { $actualAttributes = $this->_model->prepareAttributesWithDefaultValueForSave($rowData, $withDefaultValue); foreach ($expectedAttributes as $key => $value) { $this->assertArrayHasKey($key, $actualAttributes); $this->assertEquals($value, $actualAttributes[$key]); } }
/** * 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->addAdditionalAttributes($rowData)); return $resultAttrs; }
/** * 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->transformBundleCustomAttributes($rowData)); return $resultAttrs; }