當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CatalogProductIndex::getProductBlock方法代碼示例

本文整理匯總了PHP中Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex::getProductBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP CatalogProductIndex::getProductBlock方法的具體用法?PHP CatalogProductIndex::getProductBlock怎麽用?PHP CatalogProductIndex::getProductBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex的用法示例。


在下文中一共展示了CatalogProductIndex::getProductBlock方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testCreateDownloadableProduct

 /**
  * Test create downloadable product
  *
  * @param CatalogProductDownloadable $product
  * @param CatalogCategory $category
  */
 public function testCreateDownloadableProduct(CatalogProductDownloadable $product, CatalogCategory $category)
 {
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getProductBlock()->addProduct('downloadable');
     $productBlockForm = $this->catalogProductNew->getForm();
     $productBlockForm->fillProduct($product, $category);
     $this->catalogProductNew->getFormAction()->save();
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:14,代碼來源:CreateDownloadableProductEntityTest.php

示例2: testCreate

 /**
  * Run create product virtual entity test
  *
  * @param CatalogProductVirtual $product
  * @param CatalogCategory $category
  * @return void
  */
 public function testCreate(CatalogProductVirtual $product, CatalogCategory $category)
 {
     // Steps
     $this->productGrid->open();
     $this->productGrid->getProductBlock()->addProduct('virtual');
     $productBlockForm = $this->newProductPage->getForm();
     $productBlockForm->fillProduct($product, $category);
     $this->newProductPage->getFormAction()->save();
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:16,代碼來源:CreateVirtualProductEntityTest.php

示例3: testCreate

 /**
  * Run create configurable product test
  *
  * @param CatalogProductConfigurable $configurable
  * @param CatalogCategory $category
  * @return void
  */
 public function testCreate(CatalogProductConfigurable $configurable, CatalogCategory $category)
 {
     // Steps
     $this->productPageGrid->open();
     $this->productPageGrid->getProductBlock()->addProduct('configurable');
     // Fill form
     $productBlockForm = $this->newProductPage->getConfigurableProductForm();
     $productBlockForm->fillProduct($configurable, $category);
     $this->newProductPage->getFormAction()->saveProduct($this->newProductPage, $configurable);
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:17,代碼來源:CreateConfigurableEntityTest.php

示例4: processAssert

 /**
  * Assert check whether the attribute is used to create a configurable products
  *
  * @param CatalogProductAttribute $productAttribute
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductIndex $productGrid
  * @param FixtureFactory $fixtureFactory
  * @param CatalogProductNew $newProductPage
  */
 public function processAssert(CatalogProductAttribute $attribute, CatalogProductIndex $productGrid, FixtureFactory $fixtureFactory, CatalogProductNew $newProductPage, CatalogProductAttribute $productAttribute = null)
 {
     $this->attribute = !is_null($productAttribute) ? $productAttribute : $attribute;
     $productGrid->open();
     $productGrid->getProductBlock()->addProduct('configurable');
     $productConfigurable = $fixtureFactory->createByCode('catalogProductConfigurable', ['dataSet' => 'default', 'data' => ['configurable_attributes_data' => ['preset' => 'one_variations', 'attributes' => [$this->attribute]]]]);
     $productBlockForm = $newProductPage->getForm();
     $productBlockForm->fillProduct($productConfigurable);
     \PHPUnit_Framework_Assert::assertTrue($newProductPage->getForm()->findAttribute($this->attribute->getFrontendLabel()), "Product attribute is absent on the product page.");
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:19,代碼來源:AssertProductAttributeIsConfigurable.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 $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

示例6: 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
  * @return void
  */
 public function processAssert(CatalogProductAttribute $productAttribute, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
 {
     $productGrid->open();
     $productGrid->getProductBlock()->addProduct('simple');
     \PHPUnit_Framework_Assert::assertFalse($newProductPage->getForm()->checkAttributeInSearchAttributeForm($productAttribute), "Product attribute found in Attribute Search form.");
 }
開發者ID:Atlis,項目名稱:docker-magento2,代碼行數:14,代碼來源:AssertProductAttributeAbsenceInSearchOnProductForm.php


注:本文中的Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex::getProductBlock方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。