• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Adminhtml\CatalogProductIndex类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: processAssert

 /**
  * Assert that after deleting product success message.
  *
  * @param FixtureInterface|FixtureInterface[] $product
  * @param CatalogProductIndex $productPage
  * @return void
  */
 public function processAssert($product, CatalogProductIndex $productPage)
 {
     $products = is_array($product) ? $product : [$product];
     $deleteMessage = sprintf(self::SUCCESS_DELETE_MESSAGE, count($products));
     $actualMessage = $productPage->getMessagesBlock()->getSuccessMessage();
     \PHPUnit_Framework_Assert::assertEquals($deleteMessage, $actualMessage, 'Wrong success message is displayed.' . "\nExpected: " . $deleteMessage . "\nActual: " . $actualMessage);
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:14,代码来源:AssertProductSuccessDeleteMessage.php


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


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

 /**
  * Assert that after mass update successful message appears.
  *
  * @param CatalogProductIndex $productGrid
  * @param array $products
  * @return void
  */
 public function processAssert(CatalogProductIndex $productGrid, $products = [])
 {
     $countProducts = count($products) ? count($products) : 1;
     $expectedMessage = sprintf(self::SUCCESS_MESSAGE, $countProducts);
     $actualMessage = $productGrid->getMessagesBlock()->getSuccessMessages();
     \PHPUnit_Framework_Assert::assertEquals($expectedMessage, $actualMessage, 'Wrong success message is displayed.');
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:14,代码来源:AssertMassProductUpdateSuccessMessage.php


示例5: processAssert

 /**
  * Assert that duplicated product is found by sku and has correct product type, product template,
  * product status disabled and out of stock
  *
  * @param FixtureInterface $product
  * @param CatalogProductIndex $productGrid
  * @return void
  */
 public function processAssert(FixtureInterface $product, CatalogProductIndex $productGrid)
 {
     $config = $product->getDataConfig();
     $filter = ['name' => $product->getName(), 'visibility' => $product->getVisibility(), 'status' => 'Disabled', 'sku' => $product->getSku() . '-1', 'type' => ucfirst($config['create_url_params']['type']) . ' Product', 'price_to' => number_format($product->getPrice(), 2)];
     $productGrid->open()->getProductGrid()->search($filter);
     $filter['price_to'] = '$' . $filter['price_to'];
     \PHPUnit_Framework_Assert::assertTrue($productGrid->getProductGrid()->isRowVisible($filter, false), 'Product duplicate is absent in Products grid.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:AssertProductDuplicatedInGrid.php


示例6: processAssert

 /**
  * Assert that deleted attribute can't be added to attribute set 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->getGridPageActionBlock()->addProduct('simple');
     $newProductPage->getFormPageActions()->addNewAttribute();
     $filter = ['label' => $productAttribute->getFrontendLabel()];
     \PHPUnit_Framework_Assert::assertFalse($newProductPage->getProductForm()->getAttributesSearchGrid()->isRowVisible($filter), 'Attribute \'' . $productAttribute->getFrontendLabel() . '\' is found in Attributes grid.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:16,代码来源:AssertProductAttributeAbsenceInSearchOnProductForm.php


示例7: processAssert

 /**
  * Assert that video is not displayed in admin panel.
  *
  * @param CatalogProductIndex $productGrid
  * @param InjectableFixture $product
  * @return void
  */
 public function processAssert(CatalogProductIndex $productGrid, InjectableFixture $product)
 {
     $filter = ['sku' => $product->getSku()];
     $productGrid->open();
     $productGrid->getProductGrid()->search($filter);
     $src = $productGrid->getProductGrid()->getBaseImageSource();
     \PHPUnit_Framework_Assert::assertTrue(strpos($src, '/placeholder/') !== false, 'Product image is displayed in product grid when it should not');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:AssertProductNoImageInGrid.php


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


示例9: processAssert

 /**
  * Assert that customer group not on product page.
  *
  * @param CatalogProductIndex $catalogProductIndex
  * @param CatalogProductNew $catalogProductNew
  * @param CustomerGroup $customerGroup
  * @return void
  */
 public function processAssert(CatalogProductIndex $catalogProductIndex, CatalogProductNew $catalogProductNew, CustomerGroup $customerGroup)
 {
     $catalogProductIndex->open();
     $catalogProductIndex->getGridPageActionBlock()->addProduct();
     $catalogProductNew->getProductForm()->openSection('advanced-pricing');
     /** @var AdvancedPricing $advancedPricingTab */
     $advancedPricingTab = $catalogProductNew->getProductForm()->getSection('advanced-pricing');
     \PHPUnit_Framework_Assert::assertFalse($advancedPricingTab->getTierPriceForm()->isVisibleCustomerGroup($customerGroup), "Customer group {$customerGroup->getCustomerGroupCode()} is still in tier price form on product page.");
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:17,代码来源:AssertCustomerGroupNotOnProductForm.php


示例10: processAssert

 /**
  * Assert that product cannot be found by name and sku
  *
  * @param FixtureInterface|FixtureInterface[] $product
  * @param CatalogProductIndex $productGrid
  * @return void
  */
 public function processAssert($product, CatalogProductIndex $productGrid)
 {
     $products = is_array($product) ? $product : [$product];
     foreach ($products as $product) {
         $filter = ['sku' => $product->getSku(), 'name' => $product->getName()];
         $productGrid->open();
         \PHPUnit_Framework_Assert::assertFalse($productGrid->getProductGrid()->isRowVisible($filter), "Product with sku \"{$filter['sku']}\" and name \"{$filter['name']}\" is attend in Products grid.");
     }
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:16,代码来源:AssertProductNotInGrid.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() . '-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);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AssertProductDuplicateForm.php


示例12: 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.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:18,代码来源:AssertGetVideoInfoDataIsCorrect.php


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


示例14: 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->getGridPageActionBlock()->addProduct('configurable');
     $productConfigurable = $fixtureFactory->createByCode('catalogProductConfigurable', ['dataSet' => 'default', 'data' => ['configurable_attributes_data' => ['preset' => 'one_variation', 'attributes' => [$this->attribute]]]]);
     $productBlockForm = $newProductPage->getProductForm();
     $productBlockForm->fill($productConfigurable);
     \PHPUnit_Framework_Assert::assertTrue($productBlockForm->checkAttributeInSearchAttributeForm($this->attribute), "Product attribute is absent on the product page.");
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:19,代码来源:AssertProductAttributeIsConfigurable.php


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


示例16: 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->getProductForm()->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:shabbirvividads,项目名称:magento2,代码行数:18,代码来源:AssertGroupedProductForm.php


示例17: processAssert

 /**
  * Assert that deleted attribute can't be added to attribute set on Product Page via Add Attribute control.
  *
  * @param CatalogProductAttribute $productAttribute
  * @param ConfigurableProduct $assertProduct
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductNew $newProductPage
  * @return void
  */
 public function processAssert(CatalogProductAttribute $productAttribute, ConfigurableProduct $assertProduct, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
 {
     $productGrid->open();
     $productGrid->getGridPageActionBlock()->addProduct('simple');
     /** @var VariationsTab $variationsTab */
     $newProductPage->getProductForm()->fill($assertProduct);
     $variationsTab = $newProductPage->getProductForm()->getSection(self::TAB_VARIATIONS);
     $variationsTab->createConfigurations();
     $attributesGrid = $variationsTab->getAttributeBlock()->getAttributesGrid();
     \PHPUnit_Framework_Assert::assertFalse($attributesGrid->isRowVisible(['frontend_label' => $productAttribute->getFrontendLabel()]), "Product attribute found in Attribute Search form.");
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:20,代码来源:AssertProductAttributeAbsenceInVariationsSearch.php


示例18: 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->getGridPageActionBlock()->addProduct('simple');
     /** @var VariationsTab $variationsTab */
     $variationsTab = $newProductPage->getProductForm()->getTab(self::TAB_VARIATIONS);
     $variationsTab->showContent();
     /** @var AttributeBlock $attributesBlock */
     $attributesBlock = $variationsTab->getAttributeBlock();
     \PHPUnit_Framework_Assert::assertFalse($attributesBlock->getAttributeSelector()->isExistAttributeInSearchResult($productAttribute), "Product attribute found in Attribute Search form.");
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:19,代码来源:AssertProductAttributeAbsenceInVariationsSearch.php


示例19: processAssert

 /**
  * Add this attribute to Default attribute Template. Create product and Assert that created attribute
  * is displayed on product form (Products > Inventory > Catalog).
  *
  * @param InjectableFixture $product
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductEdit $productEdit
  * @param CatalogProductAttribute $attribute
  * @param CatalogAttributeSet $attributeSet
  * @param CatalogProductAttribute $productAttributeOriginal
  * @throws \Exception
  * @return void
  */
 public function processAssert(InjectableFixture $product, CatalogProductIndex $productGrid, CatalogProductEdit $productEdit, CatalogProductAttribute $attribute, CatalogAttributeSet $attributeSet, CatalogProductAttribute $productAttributeOriginal = null)
 {
     if (!$product->hasData('sku')) {
         $product = $this->createProductWithAttributeSet($productAttributeOriginal, $attributeSet);
     }
     $filterProduct = ['sku' => $product->getSku()];
     $productGrid->open();
     $productGrid->getProductGrid()->searchAndOpen($filterProduct);
     $catalogProductAttribute = $productAttributeOriginal !== null ? array_merge($productAttributeOriginal->getData(), $attribute->getData()) : $attribute->getData();
     \PHPUnit_Framework_Assert::assertTrue($productEdit->getProductForm()->checkAttributeLabel($catalogProductAttribute), "Product Attribute is absent on Product form.");
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:24,代码来源:AssertAddedProductAttributeOnProductForm.php


示例20: processAssert

 /**
  * Assert check whether the attribute is used to create a configurable products.
  *
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductNew $newProductPage
  */
 public function processAssert(CatalogProductAttribute $attribute, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage)
 {
     $productGrid->open();
     $productGrid->getGridPageActionBlock()->addProduct('configurable');
     $productBlockForm = $newProductPage->getProductForm();
     $productBlockForm->openTab('variations');
     /** @var TabVariation $tabVariation */
     $tabVariation = $productBlockForm->getTab('variations');
     $configurableAttributeSelector = $tabVariation->getAttributeBlock()->getAttributeSelector();
     \PHPUnit_Framework_Assert::assertTrue($configurableAttributeSelector->isExistAttributeInSearchResult($attribute), "Product attribute is absent on the product page.");
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:18,代码来源:AssertProductAttributeIsConfigurable.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Adminhtml\CatalogProductNew类代码示例发布时间:2022-05-23
下一篇:
PHP Adminhtml\CatalogProductEdit类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap