本文整理汇总了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.');
}
示例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);
}
示例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.');
}
示例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();
}
示例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.");
}
示例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];
}
示例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];
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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.");
}
}
示例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();
}
示例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();
}
示例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);
}