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


PHP CatalogProductEdit::getFormPageActions方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: processAssert

 /**
  * Check whether the attribute is mandatory.
  *
  * @param CatalogProductIndex $catalogProductIndex
  * @param CatalogProductEdit $catalogProductEdit
  * @param CatalogProductAttribute $attribute
  * @param InjectableFixture $product
  * @return void
  */
 public function processAssert(CatalogProductIndex $catalogProductIndex, CatalogProductEdit $catalogProductEdit, CatalogProductAttribute $attribute, InjectableFixture $product)
 {
     $catalogProductIndex->open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]);
     $productForm = $catalogProductEdit->getProductForm();
     $productForm->getAttributeElement($attribute)->setValue('');
     $catalogProductEdit->getFormPageActions()->save();
     $failedAttributes = $productForm->getRequireNoticeAttributes($product);
     $actualMessage = $failedAttributes['product-details'][$attribute->getFrontendLabel()];
     \PHPUnit_Framework_Assert::assertEquals(self::REQUIRE_MESSAGE, $actualMessage, 'JS error notice on product edit page is not equal to expected.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:19,代码来源:AssertProductAttributeIsRequired.php

示例9: test

 /**
  * Run test duplicate product entity.
  *
  * @param string $productType
  * @return array
  */
 public function test($productType)
 {
     // Precondition
     $product = $this->createProduct($productType);
     // Steps
     $filter = ['sku' => $product->getSku()];
     $this->productGrid->open();
     $this->productGrid->getProductGrid()->searchAndOpen($filter);
     $this->editProductPage->getFormPageActions()->saveAndDuplicate();
     return ['product' => $product];
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:DuplicateProductEntityTest.php

示例10: processAssert

 /**
  * Check whether the attribute is unique.
  *
  * @param CatalogProductIndex $catalogProductIndex
  * @param CatalogProductEdit $catalogProductEdit
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductSimple $product,
  * @param FixtureFactory $fixtureFactory
  * @throws \Exception
  * @return void
  */
 public function processAssert(CatalogProductIndex $catalogProductIndex, CatalogProductEdit $catalogProductEdit, CatalogProductAttribute $attribute, CatalogProductSimple $product, FixtureFactory $fixtureFactory)
 {
     $simpleProduct = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'product_with_category_with_anchor', 'data' => ['attribute_set_id' => ['attribute_set' => $product->getDataFieldConfig('attribute_set_id')['source']->getAttributeSet()], 'custom_attribute' => $attribute]]);
     $catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple');
     $productForm = $catalogProductEdit->getProductForm();
     $productForm->fill($simpleProduct);
     $catalogProductEdit->getFormPageActions()->save();
     $failedAttributes = $productForm->getRequireNoticeAttributes($simpleProduct);
     $actualMessage = isset($failedAttributes['product-details'][$attribute->getFrontendLabel()]) ? $failedAttributes['product-details'][$attribute->getFrontendLabel()] : null;
     \PHPUnit_Framework_Assert::assertEquals(sprintf(self::UNIQUE_MESSAGE, $attribute->getFrontendLabel()), $actualMessage, 'JS error notice on product edit page is not equal to expected.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:22,代码来源:AssertProductAttributeIsUnique.php

示例11: processAssert

 /**
  * Check whether the attribute is unique.
  *
  * @param CatalogProductIndex $catalogProductIndex
  * @param CatalogProductEdit $catalogProductEdit
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductSimple $product ,
  * @param FixtureFactory $fixtureFactory
  * @throws \Exception
  * @return void
  */
 public function processAssert(CatalogProductIndex $catalogProductIndex, CatalogProductEdit $catalogProductEdit, CatalogProductAttribute $attribute, CatalogProductSimple $product, FixtureFactory $fixtureFactory)
 {
     $this->fixtureFactory = $fixtureFactory;
     $simpleProduct = $this->createSimpleProductFixture($product, $attribute);
     $catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple');
     $productForm = $catalogProductEdit->getProductForm();
     $productForm->fill($simpleProduct);
     $catalogProductEdit->getFormPageActions()->save();
     $actualErrorMessage = $catalogProductEdit->getMessagesBlock()->getErrorMessage();
     $attributeLabel = $attribute->getFrontendLabel();
     \PHPUnit_Framework_Assert::assertEquals(sprintf(self::UNIQUE_MESSAGE, $attributeLabel), $actualErrorMessage, 'JS error notice on product edit page is not equal to expected.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:23,代码来源:AssertProductAttributeIsUnique.php

示例12: processAssert

 /**
  * Check whether the attribute is mandatory.
  *
  * @param CatalogProductIndex $catalogProductIndex
  * @param CatalogProductEdit $catalogProductEdit
  * @param CatalogProductAttribute $attribute
  * @param InjectableFixture $product
  * @param string $sectionName
  * @return void
  */
 public function processAssert(CatalogProductIndex $catalogProductIndex, CatalogProductEdit $catalogProductEdit, CatalogProductAttribute $attribute, InjectableFixture $product, $sectionName)
 {
     $catalogProductIndex->open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]);
     $productForm = $catalogProductEdit->getProductForm();
     if (!$productForm->checkAttributeLabel($attribute)) {
         $productForm->openSection($sectionName);
     }
     $productForm->getAttributeElement($attribute)->setValue('');
     $catalogProductEdit->getFormPageActions()->save();
     $validationErrors = $productForm->getSection($sectionName)->getValidationErrors();
     $actualMessage = isset($validationErrors[$attribute->getFrontendLabel()]) ? $validationErrors[$attribute->getFrontendLabel()] : '';
     \PHPUnit_Framework_Assert::assertEquals(self::REQUIRE_MESSAGE, $actualMessage, 'JS error notice on product edit page is not equal to expected.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:23,代码来源:AssertProductAttributeIsRequired.php

示例13: run

 /**
  * Create a new product with the given attribute set
  *
  * @return array
  */
 public function run()
 {
     // Create product with attribute set mentioned above:
     $customAttribute = $this->attribute;
     if ($this->attributeValue !== null) {
         $customAttribute = ['value' => $this->attributeValue, 'attribute' => $customAttribute];
     }
     $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataset' => 'product_with_category_with_anchor', 'data' => ['attribute_set_id' => ['attribute_set' => $this->attributeSet], 'custom_attribute' => $customAttribute]]);
     $this->catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple');
     $productForm = $this->catalogProductEdit->getProductForm();
     $productForm->fill($product);
     $this->catalogProductEdit->getFormPageActions()->save();
     return ['product' => $product];
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:19,代码来源:CreateProductWithAttributeSetStep.php

示例14: run

 /**
  * Move attribute To attribute set.
  *
  * @return array
  */
 public function run()
 {
     $filterAttribute = ['set_name' => $this->attributeSet->getAttributeSetName()];
     $this->catalogProductSetIndex->open()->getGrid()->searchAndOpen($filterAttribute);
     $this->catalogProductSetEdit->getAttributeSetEditBlock()->moveAttribute($this->attribute->getData());
     $this->catalogProductSetEdit->getPageActions()->save();
     // Create product with attribute set mentioned above:
     $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataset' => 'product_with_category_with_anchor', 'data' => ['attribute_set_id' => ['attribute_set' => $this->attributeSet], 'custom_attribute' => $this->attribute]]);
     $this->catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple');
     $productForm = $this->catalogProductEdit->getProductForm();
     $productForm->fill($product);
     $this->catalogProductEdit->getFormPageActions()->save();
     return ['product' => $product];
 }
开发者ID:CompassPointMedia,项目名称:magento2,代码行数:19,代码来源:AddAttributeToAttributeSetStep.php

示例15: test

 /**
  * Run product type switching on updating test.
  *
  * @param string $productOrigin
  * @param string $product
  * @param string $actionName
  * @return array
  */
 public function test($productOrigin, $product, $actionName)
 {
     // Preconditions
     list($fixtureClass, $dataset) = explode('::', $productOrigin);
     $productOrigin = $this->fixtureFactory->createByCode(trim($fixtureClass), ['dataset' => trim($dataset)]);
     $productOrigin->persist();
     list($fixtureClass, $dataset) = explode('::', $product);
     $product = $this->fixtureFactory->createByCode(trim($fixtureClass), ['dataset' => trim($dataset)]);
     // Steps
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getProductGrid()->searchAndOpen(['sku' => $productOrigin->getSku()]);
     $this->performAction($actionName);
     $this->catalogProductEdit->getProductForm()->fill($product);
     $this->catalogProductEdit->getFormPageActions()->save($product);
     return ['product' => $product];
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:24,代码来源:ProductTypeSwitchingOnUpdateTest.php


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