本文整理匯總了PHP中Magento\Framework\TestFramework\Unit\Helper\ObjectManager::prepareAttributesWithDefaultValueForSave方法的典型用法代碼示例。如果您正苦於以下問題:PHP ObjectManager::prepareAttributesWithDefaultValueForSave方法的具體用法?PHP ObjectManager::prepareAttributesWithDefaultValueForSave怎麽用?PHP ObjectManager::prepareAttributesWithDefaultValueForSave使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\TestFramework\Unit\Helper\ObjectManager
的用法示例。
在下文中一共展示了ObjectManager::prepareAttributesWithDefaultValueForSave方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testPrepareAttributesWithDefaultValueForSave
/**
* Test for method prepareAttributesWithDefaultValueForSave
*/
public function testPrepareAttributesWithDefaultValueForSave()
{
$rowData = ['_attribute_set' => 'Default', 'sku' => 'downloadablesku1', 'product_type' => 'downloadable', 'name' => 'Downloadable Product 1', 'downloadable_samples' => 'group_title=Group Title Samples, title=Title 1, file=media/file.mp4,sortorder=1' . '|group_title=Group Title, title=Title 2, url=media/file2.mp4,sortorder=0', 'downloadable_links' => 'group_title=Group Title Links, title=Title 1, price=10, downloads=unlimited,' . ' file=media/file_link.mp4,sortorder=1|group_title=Group Title, title=Title 2, price=10, downloads' . '=unlimited, url=media/file2.mp4,sortorder=0'];
$this->connectionMock->expects($this->any())->method('fetchAll')->with($this->select)->willReturnOnConsecutiveCalls([['attribute_set_name' => '1', 'attribute_id' => '1'], ['attribute_set_name' => '2', 'attribute_id' => '2']]);
$this->downloadableModelMock = $this->objectManagerHelper->getObject('\\Magento\\DownloadableImportExport\\Model\\Import\\Product\\Type\\Downloadable', ['attrSetColFac' => $this->attrSetColFacMock, 'prodAttrColFac' => $this->prodAttrColFacMock, 'resource' => $this->resourceMock, 'params' => $this->paramsArray, 'uploaderHelper' => $this->uploaderHelper, 'downloadableHelper' => $this->downloadableHelper]);
$this->setPropertyValue($this->downloadableModelMock, '_attributes', ['Default' => ['name' => ['id' => '69', 'code' => 'name', 'is_global' => '0', 'is_required' => '1', 'is_unique' => '0', 'frontend_label' => 'Name', 'is_static' => false, 'apply_to' => [], 'type' => 'varchar', 'default_value' => null, 'options' => []], 'sku' => ['id' => '70', 'code' => 'sku', 'is_global' => '1', 'is_required' => '1', 'is_unique' => '1', 'frontend_label' => 'SKU', 'is_static' => true, 'apply_to' => [], 'type' => 'varchar', 'default_value' => null, 'options' => []]]]);
$this->downloadableModelMock->prepareAttributesWithDefaultValueForSave($rowData);
}