本文整理匯總了PHP中Magento\Framework\TestFramework\Unit\Helper\ObjectManager::convertTo方法的典型用法代碼示例。如果您正苦於以下問題:PHP ObjectManager::convertTo方法的具體用法?PHP ObjectManager::convertTo怎麽用?PHP ObjectManager::convertTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\TestFramework\Unit\Helper\ObjectManager
的用法示例。
在下文中一共展示了ObjectManager::convertTo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testConvertTo
public function testConvertTo()
{
/** @var $product \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product */
$product = $this->getMock('\\Magento\\Catalog\\Model\\Product', [], [], '', false);
$rowData = ['value_id' => '4', 'file' => '/i/n/index111111.jpg', 'media_type' => ExternalVideoEntryConverter::MEDIA_TYPE_CODE, 'entity_id' => '1', 'label' => '', 'position' => '3', 'disabled' => '0', 'label_default' => null, 'position_default' => '3', 'disabled_default' => '0', 'video_provider' => null, 'video_url' => 'https://www.youtube.com/watch?v=abcdefghij', 'video_title' => '111', 'video_description' => null, 'video_metadata' => null];
$productImages = ['image' => '/s/a/sample_3.jpg', 'small_image' => '/s/a/sample-1_1.jpg', 'thumbnail' => '/s/a/sample-1_1.jpg', 'swatch_image' => '/s/a/sample_3.jpg'];
$product->expects($this->once())->method('getMediaAttributeValues')->willReturn($productImages);
$this->mediaGalleryEntryMock->expects($this->once())->method('setExtensionAttributes')->will($this->returnSelf());
$this->modelObject->convertTo($product, $rowData);
}