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


PHP CatalogProductIndex::open方法代碼示例

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


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

示例1: test

 /**
  * Test create grouped product
  *
  * @param GroupedProduct $product
  * @param Category $category
  * @return void
  */
 public function test(GroupedProduct $product, Category $category)
 {
     //Steps
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getGridPageActionBlock()->addProduct('grouped');
     $this->catalogProductNew->getProductForm()->fill($product, null, $category);
     $this->catalogProductNew->getFormPageActions()->save();
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:15,代碼來源:CreateGroupedProductEntityTest.php

示例2: test

 /**
  * Test create catalog Configurable product run
  *
  * @param ConfigurableProduct $product
  * @return void
  */
 public function test(ConfigurableProduct $product)
 {
     // Steps
     $this->productIndex->open();
     $this->productIndex->getGridPageActionBlock()->addProduct('configurable');
     $this->productNew->getProductForm()->fill($product);
     $this->productNew->getFormPageActions()->save($product);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:14,代碼來源:CreateConfigurableProductEntityTest.php

示例3: testCreate

 /**
  * Run create product virtual entity test
  *
  * @param CatalogProductVirtual $product
  * @param Category $category
  * @return void
  */
 public function testCreate(CatalogProductVirtual $product, Category $category)
 {
     // Steps
     $this->productGrid->open();
     $this->productGrid->getGridPageActionBlock()->addProduct('virtual');
     $this->newProductPage->getProductForm()->fill($product, null, $category);
     $this->newProductPage->getFormPageActions()->save();
 }
開發者ID:koliaGI,項目名稱:magento2,代碼行數:15,代碼來源:CreateVirtualProductEntityTest.php

示例4: test

 /**
  * Test create bundle product
  *
  * @param BundleProduct $product
  * @param Category $category
  * @return void
  */
 public function test(BundleProduct $product, Category $category)
 {
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getGridPageActionBlock()->addProduct('bundle');
     $productBlockForm = $this->catalogProductNew->getProductForm();
     $productBlockForm->fill($product, null, $category);
     $this->catalogProductNew->getFormPageActions()->save();
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:15,代碼來源:CreateBundleProductEntityTest.php

示例5: test

 /**
  * Test create catalog Configurable product run
  *
  * @param ConfigurableProduct $product
  * @return void
  */
 public function test(ConfigurableProduct $product)
 {
     $this->markTestIncomplete('MAGETWO-40002');
     // Steps
     $this->productIndex->open();
     $this->productIndex->getGridPageActionBlock()->addProduct('configurable');
     $this->productNew->getProductForm()->fill($product);
     $this->productNew->getFormPageActions()->save($product);
 }
開發者ID:nja78,項目名稱:magento2,代碼行數:15,代碼來源:CreateConfigurableProductEntityTest.php

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

示例7: test

 /**
  * Run product type switching on creation test
  *
  * @param string $createProduct
  * @param string $product
  * @return array
  */
 public function test($createProduct, $product)
 {
     // Steps
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getGridPageActionBlock()->addProduct($createProduct);
     list($fixture, $dataSet) = explode('::', $product);
     $product = $this->fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]);
     $this->catalogProductNew->getProductForm()->fill($product);
     $this->catalogProductNew->getFormPageActions()->save($product);
     return ['product' => $product];
 }
開發者ID:opexsw,項目名稱:magento2,代碼行數:18,代碼來源:ProductTypeSwitchingOnCreationTest.php

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

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

示例10: test

 /**
  * Run delete product test.
  *
  * @param string $products
  * @param FixtureFactory $fixtureFactory
  * @param Category $category
  * @return array
  */
 public function test($products, FixtureFactory $fixtureFactory, Category $category)
 {
     //Steps
     $products = explode(',', $products);
     $deleteProducts = [];
     foreach ($products as &$product) {
         list($fixture, $dataset) = explode('::', $product);
         $product = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset, 'data' => ['category_ids' => ['category' => $category]]]);
         $product->persist();
         $deleteProducts[] = ['sku' => $product->getSku()];
     }
     $this->catalogProductIndex->open();
     $this->catalogProductIndex->getProductGrid()->massaction($deleteProducts, 'Delete', true);
     return ['product' => $products];
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:23,代碼來源:DeleteProductEntityTest.php

示例11: test

 /**
  * Run mass update product simple entity test.
  *
  * @param CatalogProductSimple $initialProduct
  * @param CatalogProductSimple $product
  * @param string $configData
  * @return array
  */
 public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product, $configData)
 {
     $this->configData = $configData;
     // Preconditions
     $initialProduct->persist();
     $this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $configData])->run();
     // Steps
     $this->productGrid->open();
     $this->productGrid->getProductGrid()->updateAttributes([['sku' => $initialProduct->getSku()]]);
     $this->attributeMassActionPage->getAttributesBlockForm()->fill($product);
     $this->attributeMassActionPage->getFormPageActions()->save();
     $data = array_merge($initialProduct->getData(), $product->getData());
     $product = $this->objectManager->create('Magento\\Catalog\\Test\\Fixture\\CatalogProductSimple', ['data' => $data]);
     return ['category' => $initialProduct->getDataFieldConfig('category_ids')['source']->getCategories()[0], 'product' => $product];
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:23,代碼來源:MassProductUpdateTest.php

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

示例13: processAssert

 /**
  * Assert that product is present in products grid and can be found by sku, type, status and attribute set.
  *
  * @param FixtureInterface $product
  * @param CatalogProductIndex $productIndex
  * @return void
  */
 public function processAssert(FixtureInterface $product, CatalogProductIndex $productIndex)
 {
     $this->product = $product;
     $productIndex->open();
     $productIndex->getProductGrid()->resetFilter();
     \PHPUnit_Framework_Assert::assertTrue($productIndex->getProductGrid()->isRowVisible($this->prepareFilter()), 'Product \'' . $this->product->getName() . '\' is absent in Products grid.');
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:14,代碼來源:AssertProductInGrid.php

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

示例15: test

 /**
  * Run update product simple entity test.
  *
  * @param CatalogProductSimple $initialProduct
  * @param CatalogProductSimple $product
  * @param string $configData
  * @return array
  */
 public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product, $configData = '')
 {
     $this->configData = $configData;
     // 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;
     $this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $configData])->run();
     // 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:kidaa30,項目名稱:magento2-platformsh,代碼行數:24,代碼來源:UpdateSimpleProductEntityTest.php


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