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