当前位置: 首页>>代码示例>>PHP>>正文


PHP CatalogProductEdit::getProductForm方法代码示例

本文整理汇总了PHP中Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit::getProductForm方法的典型用法代码示例。如果您正苦于以下问题:PHP CatalogProductEdit::getProductForm方法的具体用法?PHP CatalogProductEdit::getProductForm怎么用?PHP CatalogProductEdit::getProductForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit的用法示例。


在下文中一共展示了CatalogProductEdit::getProductForm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processAssert

 /**
  * Assert that video data received from external service is correct.
  *
  * @param CatalogProductEdit $editProductPage
  * @param InjectableFixture $initialProduct
  * @param array $video
  * @return void
  */
 public function processAssert(CatalogProductEdit $editProductPage, InjectableFixture $initialProduct, array $video)
 {
     $editProductPage->open(['id' => $initialProduct->getId()]);
     $editProductPage->getProductForm()->openTab('images-and-videos');
     $imagesTab = $editProductPage->getProductForm()->getTab('images-and-videos');
     $result = $imagesTab->clickFirstVideo()->getVideoDialog()->validate($video);
     \PHPUnit_Framework_Assert::assertTrue($result, 'Video data received from external service is not correct.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:16,代码来源:AssertGetVideoInfoDataIsCorrect.php

示例2: run

 /**
  * Set Default Attribute Value.
  *
  * @return void
  */
 public function run()
 {
     $customAttribute = $this->attribute;
     if ($this->attributeValue !== null) {
         $customAttribute = ['value' => $this->attributeValue, 'attribute' => $customAttribute];
     }
     $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['data' => ['custom_attribute' => $customAttribute]]);
     $this->catalogProductEdit->getProductForm()->fill($product);
 }
开发者ID:Zash22,项目名称:magento,代码行数:14,代码来源:SetDefaultAttributeValueStep.php

示例3: processAssert

 /**
  * Assert that video data received from external service is correct.
  *
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductEdit $editProductPage
  * @param InjectableFixture $product
  * @param array $video
  * @return void
  */
 public function processAssert(CatalogProductIndex $productGrid, CatalogProductEdit $editProductPage, InjectableFixture $product, array $video)
 {
     $productGrid->open();
     $productGrid->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]);
     $editProductPage->getProductForm()->openSection('images-and-videos');
     $imagesTab = $editProductPage->getProductForm()->getSection('images-and-videos');
     $result = $imagesTab->clickFirstVideo()->getVideoDialog()->validate($video);
     \PHPUnit_Framework_Assert::assertTrue($result, 'Video data received from external service is not correct.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:18,代码来源:AssertGetVideoInfoDataIsCorrect.php

示例4: test

 /**
  * Test update grouped product.
  *
  * @param GroupedProduct $product
  * @param GroupedProduct $originalProduct
  * @return void
  */
 public function test(GroupedProduct $product, GroupedProduct $originalProduct)
 {
     // Precondition
     $originalProduct->persist();
     // Steps
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getProductGrid()->searchAndOpen(['sku' => $originalProduct->getSku()]);
     $this->catalogProductEdit->getProductForm()->fill($product);
     $this->catalogProductEdit->getFormPageActions()->save();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:17,代码来源:UpdateGroupedProductEntityTest.php

示例5: processAssert

 /**
  * Assert that created product template:
  * 1. Displays in product template suggest container dropdown
  * 2. Can be used for new created product.
  *
  * @param FixtureFactory $fixtureFactory
  * @param CatalogProductEdit $productEdit
  * @param CatalogProductIndex $productGrid
  * @param CatalogAttributeSet $attributeSet
  * @param CatalogProductNew $newProductPage
  * @param CatalogProductAttribute $productAttributeOriginal
  * @return void
  */
 public function processAssert(FixtureFactory $fixtureFactory, CatalogProductEdit $productEdit, CatalogProductIndex $productGrid, CatalogAttributeSet $attributeSet, CatalogProductNew $newProductPage, CatalogProductAttribute $productAttributeOriginal)
 {
     $productGrid->open();
     $productGrid->getGridPageActionBlock()->addProduct('simple');
     $productBlockForm = $newProductPage->getProductForm();
     /**@var CatalogProductSimple $catalogProductSimple */
     $productSimple = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default', 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]]]);
     $productBlockForm->fill($productSimple);
     \PHPUnit_Framework_Assert::assertTrue($productEdit->getProductForm()->isCustomTabVisible($attributeSet->getGroup()), "Product Group is absent on Product form tabs.");
     $productEdit->getProductForm()->openCustomTab($attributeSet->getGroup());
     \PHPUnit_Framework_Assert::assertTrue($productEdit->getProductForm()->checkAttributeLabel($productAttributeOriginal), "Product Attribute is absent on Product form.");
 }
开发者ID:niranjanssiet,项目名称:magento2,代码行数:25,代码来源:AssertProductTemplateGroupOnProductForm.php

示例6: test

 /**
  * Test update bundle product
  *
  * @param BundleProduct $product
  * @param BundleProduct $originalProduct
  * @return array
  */
 public function test(BundleProduct $product, BundleProduct $originalProduct)
 {
     // Preconditions
     $originalProduct->persist();
     $originalCategory = $originalProduct->hasData('category_ids') ? $originalProduct->getDataFieldConfig('category_ids')['source']->getCategories() : null;
     $category = $product->hasData('category_ids') ? $product->getDataFieldConfig('category_ids')['source']->getCategories() : $originalCategory;
     // Steps
     $filter = ['sku' => $originalProduct->getSku()];
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getProductGrid()->searchAndOpen($filter);
     $this->catalogProductEdit->getProductForm()->fill($product);
     $this->catalogProductEdit->getFormPageActions()->save();
     return ['category' => $category];
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:21,代码来源:UpdateBundleProductEntityTest.php

示例7: test

 /**
  * Run update product simple entity test
  *
  * @param CatalogProductSimple $initialProduct
  * @param CatalogProductSimple $product
  * @return array
  */
 public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product)
 {
     // Preconditions
     $initialProduct->persist();
     $initialCategory = $initialProduct->hasData('category_ids') ? $initialProduct->getDataFieldConfig('category_ids')['source']->getCategories()[0] : null;
     $category = $product->hasData('category_ids') && $product->getCategoryIds()[0] ? $product->getDataFieldConfig('category_ids')['source']->getCategories()[0] : $initialCategory;
     // Steps
     $filter = ['sku' => $initialProduct->getSku()];
     $this->productGrid->open();
     $this->productGrid->getProductGrid()->searchAndOpen($filter);
     $this->editProductPage->getProductForm()->fill($product);
     $this->editProductPage->getFormPageActions()->save();
     return ['category' => $category];
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:21,代码来源:UpdateSimpleProductEntityTest.php

示例8: testUpdate

 /**
  * Run update product simple entity test
  *
  * @param CatalogProductSimple $product
  * @return void
  */
 public function testUpdate(CatalogProductSimple $product)
 {
     $filter = ['sku' => $this->product->getSku()];
     $this->productGrid->open()->getProductGrid()->searchAndOpen($filter);
     $this->editProductPage->getProductForm()->fill($product);
     $this->editProductPage->getFormPageActions()->save();
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:13,代码来源:UpdateSimpleProductEntityTest.php

示例9: clearDownloadableData

 /**
  * Clear downloadable product data.
  *
  * @return void
  */
 protected function clearDownloadableData()
 {
     $this->catalogProductEdit->getProductForm()->openSection('downloadable_information');
     /** @var Downloadable $downloadableInfoTab */
     $downloadableInfoTab = $this->catalogProductEdit->getProductForm()->getSection('downloadable_information');
     $downloadableInfoTab->getDownloadableBlock('Links')->clearDownloadableData();
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:12,代码来源:ProductTypeSwitchingOnUpdateTest.php

示例10: updateProduct

 /**
  * Update product.
  *
  * @param ConfigurableProduct $product
  * @return void
  */
 protected function updateProduct(ConfigurableProduct $product)
 {
     $productForm = $this->catalogProductEdit->getProductForm();
     $productForm->openTab('variations');
     $productForm->getTab('variations')->deleteAttributes();
     $this->catalogProductEdit->getProductForm()->fill($product);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:UpdateConfigurableProductStep.php

示例11: testUpdateDownloadableProduct

 /**
  * Test update downloadable product
  *
  * @param DownloadableProductInjectable $product
  * @param CatalogCategory $category
  * @return void
  */
 public function testUpdateDownloadableProduct(DownloadableProductInjectable $product, CatalogCategory $category)
 {
     $filter = ['sku' => $this->product->getSku()];
     $this->catalogProductIndex->open()->getProductGrid()->searchAndOpen($filter);
     $productBlockForm = $this->catalogProductEdit->getProductForm();
     $productBlockForm->fill($product, null, $category);
     $this->catalogProductEdit->getFormPageActions()->save();
 }
开发者ID:zhangjiachao,项目名称:magento2,代码行数:15,代码来源:UpdateDownloadableProductEntityTest.php

示例12: processAssert

 /**
  * Assert that created product template:
  * 1. Displays in product template suggest container dropdown
  * 2. Can be used for new created product.
  *
  * @param FixtureFactory $fixtureFactory
  * @param CatalogProductEdit $productEdit
  * @param CatalogProductIndex $productGrid
  * @param CatalogAttributeSet $attributeSet
  * @param CatalogAttributeSet $attributeSetOriginal
  * @param CatalogProductNew $newProductPage
  * @param CatalogProductAttribute $productAttribute
  * @return void
  */
 public function processAssert(FixtureFactory $fixtureFactory, CatalogProductEdit $productEdit, CatalogProductIndex $productGrid, CatalogAttributeSet $attributeSet, CatalogProductNew $newProductPage, CatalogProductAttribute $productAttribute, CatalogAttributeSet $attributeSetOriginal = null)
 {
     $productGrid->open();
     $productGrid->getGridPageActionBlock()->addProduct('simple');
     $productBlockForm = $newProductPage->getProductForm();
     /**@var CatalogProductSimple $catalogProductSimple */
     $productSimple = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default', 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]]]);
     $productBlockForm->fill($productSimple);
     $newProductPage->getFormPageActions()->save();
     $formData = $productEdit->getProductForm()->getData($productSimple);
     $formAttributeSet = $formData['attribute_set_id'];
     \PHPUnit_Framework_Assert::assertEquals($attributeSet->getAttributeSetName(), $formAttributeSet, 'Attribute Set not found on Product form.' . "\nExpected: " . $attributeSet->getAttributeSetName() . "\nActual: " . $formAttributeSet);
     if ($attributeSetOriginal === null) {
         $productEdit->getProductForm()->openTab('product-details');
         \PHPUnit_Framework_Assert::assertTrue($productEdit->getProductForm()->checkAttributeLabel($productAttribute), "Product Attribute is absent on Product form.");
     }
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:31,代码来源:AssertProductTemplateOnProductForm.php

示例13: test

 /**
  * Run update product virtual entity test
  *
  * @param CatalogProductVirtual $product
  * @return void
  */
 public function test(CatalogProductVirtual $product)
 {
     // Steps
     $this->productGrid->open();
     $this->productGrid->getProductGrid()->searchAndOpen(['sku' => $this->product->getSku()]);
     $this->editProductPage->getProductForm()->fill($product);
     $this->editProductPage->getFormPageActions()->save();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:UpdateVirtualProductEntityTest.php

示例14: test

 /**
  * Test update bundle product
  *
  * @param CatalogProductBundle $product
  * @param CatalogProductBundle $originalProduct
  * @return void
  */
 public function test(CatalogProductBundle $product, CatalogProductBundle $originalProduct)
 {
     $originalProduct->persist();
     $this->catalogProductIndex->open();
     $filter = ['sku' => $originalProduct->getSku()];
     $this->catalogProductIndex->getProductGrid()->searchAndOpen($filter);
     $this->catalogProductEdit->getProductForm()->fill($product);
     $this->catalogProductEdit->getFormPageActions()->save();
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:16,代码来源:UpdateBundleProductEntityTest.php

示例15: processAssert

 /**
  * Assert form data equals fixture data.
  *
  * @param FixtureInterface $product
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductEdit $productPage
  * @return void
  */
 public function processAssert(FixtureInterface $product, CatalogProductIndex $productGrid, CatalogProductEdit $productPage)
 {
     $filter = ['sku' => $product->getSku() . '-1'];
     $productGrid->open()->getProductGrid()->searchAndOpen($filter);
     $formData = $productPage->getProductForm()->getData($product);
     $fixtureData = $this->prepareFixtureData($product->getData());
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AssertProductDuplicateForm.php


注:本文中的Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit::getProductForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。