當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。