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


PHP CatalogProductEdit::getForm方法代码示例

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


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

示例1: 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->getForm();
     /**@var CatalogProductSimple $catalogProductSimple */
     $productSimple = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default', 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]]]);
     $productBlockForm->fill($productSimple);
     \PHPUnit_Framework_Assert::assertTrue($productEdit->getForm()->isTabVisible($attributeSet->getGroup()), "Product Group is absent on Product form tabs.");
     $productEdit->getForm()->openCustomTab($attributeSet->getGroup());
     \PHPUnit_Framework_Assert::assertTrue($productEdit->getForm()->checkAttributeLabel($productAttributeOriginal), "Product Attribute is absent on Product form.");
 }
开发者ID:aiesh,项目名称:magento2,代码行数:25,代码来源:AssertProductTemplateGroupOnProductForm.php

示例2: 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 $productAttribute
  * @return void
  */
 public function processAssert(FixtureFactory $fixtureFactory, CatalogProductEdit $productEdit, CatalogProductIndex $productGrid, CatalogAttributeSet $attributeSet, CatalogProductNew $newProductPage, CatalogProductAttribute $productAttribute)
 {
     $productGrid->open();
     $productGrid->getProductBlock()->addProduct('simple');
     $productBlockForm = $newProductPage->getForm();
     /**@var CatalogProductSimple $catalogProductSimple */
     $productSimple = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'default', 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]]]);
     $productBlockForm->fillProduct($productSimple);
     $newProductPage->getFormAction()->save();
     $formData = $productEdit->getForm()->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);
     $productEdit->getForm()->openTab('product-details');
     \PHPUnit_Framework_Assert::assertTrue($productEdit->getForm()->checkAttributeLabel($productAttribute), "Product Attribute is absent on Product form.");
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:28,代码来源:AssertProductTemplateOnProductForm.php

示例3: processAssert

 /**
  * Assert that deleted attribute can't be added to product template on Product Page via Add Attribute control
  *
  * @param CatalogProductAttribute $productAttribute
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductNew $newProductPage
  * @param CatalogProductEdit $productEdit
  * @return void
  */
 public function processAssert(CatalogProductAttribute $productAttribute, CatalogProductIndex $productGrid, CatalogProductEdit $productEdit, CatalogProductNew $newProductPage)
 {
     $productGrid->open();
     $productGrid->getGridPageActionBlock()->addProduct('simple');
     $productEdit->getForm()->openVariationsTab();
     \PHPUnit_Framework_Assert::assertFalse($newProductPage->getForm()->checkAttributeInVariationsSearchAttributeForm($productAttribute), "Product attribute found in Attribute Search form.");
 }
开发者ID:aiesh,项目名称:magento2,代码行数:16,代码来源:AssertProductAttributeAbsenceInVariationsSearch.php

示例4: testUpdateDownloadableProduct

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

示例5: 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);
     $productBlockForm = $this->editProductPage->getForm();
     $productBlockForm->fillProduct($product);
     $this->editProductPage->getFormAction()->save();
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:14,代码来源:UpdateSimpleProductEntityTest.php

示例6: 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->getData('sku')];
     $productGrid->open()->getProductGrid()->searchAndOpen($filter);
     $fields = $this->convertDownloadableArray($this->prepareFixtureData($product));
     $fieldsForm = $productPage->getForm()->getData($product);
     \PHPUnit_Framework_Assert::assertEquals($fields, $fieldsForm, 'Form data not equals fixture data.');
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:16,代码来源:AssertDownloadableProductForm.php

示例7: 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->getForm()->fill($product);
     $this->editProductPage->getFormAction()->save();
 }
开发者ID:aiesh,项目名称:magento2,代码行数:14,代码来源:UpdateVirtualProductEntityTest.php

示例8: 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->getForm()->fill($product);
     $this->catalogProductEdit->getFormAction()->save();
 }
开发者ID:aiesh,项目名称:magento2,代码行数:16,代码来源:UpdateBundleProductEntityTest.php

示例9: 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->getForm()->getData($product);
     $fixtureData = $this->prepareFixtureData($product->getData(), $product);
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:17,代码来源:AssertProductDuplicateForm.php

示例10: 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()];
     $productGrid->open()->getProductGrid()->searchAndOpen($filter);
     $formData = $productPage->getForm()->getData($product);
     $fixtureData = $this->prepareFixtureData($product);
     $errors = $this->compareArray($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertTrue(empty($errors), "These data must be equal to each other:\n" . implode("\n", $errors));
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:17,代码来源:AssertProductForm.php

示例11: 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()];
     $productGrid->open()->getProductGrid()->searchAndOpen($filter);
     $fieldsForm = $productPage->getForm()->getData($product);
     $fieldsFixture = $this->prepareFixtureData($product->getData());
     $fieldsFixture['associated'] = $this->prepareGroupedOptions($fieldsFixture['associated']);
     $errors = $this->verifyData($fieldsFixture, $fieldsForm);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:18,代码来源:AssertGroupedProductForm.php

示例12: test

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

示例13: processAssert

 /**
  * Add this attribute to Default attribute Template. Create product and Assert that created attribute
  * is displayed on product form (Products > Inventory > Catalog)
  *
  * @param FixtureFactory $fixtureFactory
  * @param CatalogProductSetIndex $productSet
  * @param CatalogProductSetEdit $productSetEdit
  * @param CatalogAttributeSet $productTemplate
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductAttribute $productAttributeOriginal
  * @param CatalogProductEdit $productEdit
  * @param CatalogProductAttribute|null $productAttribute
  * @return void
  */
 public function processAssert(FixtureFactory $fixtureFactory, CatalogProductSetIndex $productSet, CatalogProductSetEdit $productSetEdit, CatalogAttributeSet $productTemplate, CatalogProductIndex $productGrid, CatalogProductEdit $productEdit, CatalogProductAttribute $productAttribute, CatalogProductAttribute $productAttributeOriginal = null)
 {
     $filterAttribute = ['set_name' => $productTemplate->getAttributeSetName()];
     $productSet->open();
     $productSet->getGrid()->searchAndOpen($filterAttribute);
     $attributeData = $productAttributeOriginal !== null ? array_merge($productAttribute->getData(), $productAttributeOriginal->getData()) : $productAttribute->getData();
     $productSetEdit->getAttributeSetEditBlock()->moveAttribute($attributeData, 'Product Details');
     $productSetEdit->getPageActions()->save();
     $product = $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'product_with_category', 'data' => ['attribute_set_id' => ['attribute_set' => $productTemplate]]]);
     $product->persist();
     $filterProduct = ['sku' => $product->getSku()];
     $productGrid->open();
     $productGrid->getProductGrid()->searchAndOpen($filterProduct);
     $catalogProductAttribute = $productAttributeOriginal !== null ? array_merge($productAttributeOriginal->getData(), $productAttribute->getData()) : $productAttribute->getData();
     \PHPUnit_Framework_Assert::assertTrue($productEdit->getForm()->checkAttributeLabel($catalogProductAttribute), "Product Attribute is absent on Product form.");
 }
开发者ID:aiesh,项目名称:magento2,代码行数:30,代码来源:AssertAddedProductAttributeOnProductForm.php

示例14: test

 /**
  * Update product review on product page
  *
  * @param ReviewInjectable $review
  * @param int $rating
  * @return array
  */
 public function test(ReviewInjectable $review, $rating)
 {
     // Steps
     $review = $this->createReview($review, $rating);
     $this->catalogProductIndex->open();
     /** @var CatalogProductSimple $product */
     $product = $this->reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
     $this->catalogProductIndex->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]);
     $this->catalogProductEdit->getForm()->openTab('product_reviews');
     $filter = ['title' => $this->reviewInitial->getTitle(), 'sku' => $product->getSku()];
     $this->catalogProductEdit->getForm()->getTabElement('product_reviews')->getReviewsGrid()->searchAndOpen($filter);
     $this->reviewEdit->getReviewForm()->fill($review);
     $this->reviewEdit->getPageActions()->save();
     $productRating = $this->reviewInitial->getDataFieldConfig('ratings')['source']->getRatings()[0];
     return ['product' => $product, 'productRating' => $productRating];
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:23,代码来源:UpdateProductReviewEntityOnProductPageTest.php

示例15: processAssert

 /**
  * Assert that displayed product data on edit page equals passed from fixture
  *
  * @param FixtureInterface $product
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductEdit $productPage
  * @return void
  */
 public function processAssert(FixtureInterface $product, CatalogProductIndex $productGrid, CatalogProductEdit $productPage)
 {
     $productGrid->open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]);
     $form = $productPage->getForm();
     $formData = $form->getData($product);
     foreach (array_keys($formData['configurable_attributes_data']['matrix']) as $key) {
         unset($formData['configurable_attributes_data']['matrix'][$key]['price']);
     }
     $fixtureData = $this->prepareFixtureData($product->getData(), $product);
     $attributes = $fixtureData['configurable_attributes_data']['attributes_data'];
     $matrix = $fixtureData['configurable_attributes_data']['matrix'];
     unset($fixtureData['configurable_attributes_data'], $fixtureData['id']);
     $fixtureData['configurable_attributes_data']['attributes_data'] = $this->prepareAttributes($attributes);
     $fixtureData['configurable_attributes_data']['matrix'] = $this->prepareMatrix($matrix);
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:25,代码来源:AssertConfigurableProductForm.php


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