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


PHP CatalogProductEdit::getMessagesBlock方法代码示例

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


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

示例1: processAssert

 /**
  * Check whether the attribute is unique.
  *
  * @param CatalogProductIndex $catalogProductIndex
  * @param CatalogProductEdit $catalogProductEdit
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductSimple $product ,
  * @param FixtureFactory $fixtureFactory
  * @throws \Exception
  * @return void
  */
 public function processAssert(CatalogProductIndex $catalogProductIndex, CatalogProductEdit $catalogProductEdit, CatalogProductAttribute $attribute, CatalogProductSimple $product, FixtureFactory $fixtureFactory)
 {
     $this->fixtureFactory = $fixtureFactory;
     $simpleProduct = $this->createSimpleProductFixture($product, $attribute);
     $catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple');
     $productForm = $catalogProductEdit->getProductForm();
     $productForm->fill($simpleProduct);
     $catalogProductEdit->getFormPageActions()->save();
     $actualErrorMessage = $catalogProductEdit->getMessagesBlock()->getErrorMessage();
     $attributeLabel = $attribute->getFrontendLabel();
     \PHPUnit_Framework_Assert::assertEquals(sprintf(self::UNIQUE_MESSAGE, $attributeLabel), $actualErrorMessage, 'JS error notice on product edit page is not equal to expected.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:23,代码来源:AssertProductAttributeIsUnique.php

示例2: assignPromotedProducts

 /**
  * Assign promoted products.
  *
  * @param string $promotedProducts
  * @param string $type
  * @return void
  */
 protected function assignPromotedProducts($promotedProducts, $type)
 {
     $promotedProducts = $this->parsePromotedProducts($promotedProducts);
     foreach ($promotedProducts as $productName => $assignedNames) {
         $initialProduct = $this->products[$productName];
         $filter = ['sku' => $initialProduct->getSku()];
         $assignedProducts = [];
         foreach ($assignedNames as $assignedName) {
             $assignedProducts[] = $this->products[$assignedName];
         }
         $product = $this->fixtureFactory->create(get_class($initialProduct), ['data' => [$type => ['products' => $assignedProducts]]]);
         $this->catalogProductIndex->open();
         $this->catalogProductIndex->getProductGrid()->searchAndOpen($filter);
         $this->catalogProductEdit->getProductForm()->fill($product);
         $this->catalogProductEdit->getFormPageActions()->save();
         $this->catalogProductEdit->getMessagesBlock()->waitSuccessMessage();
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:25,代码来源:AbstractProductPromotedProductsTest.php

示例3: processAssert

 /**
  * Checking the output message successful product duplication
  *
  * @param CatalogProductEdit $productPage
  * @return void
  */
 public function processAssert(CatalogProductEdit $productPage)
 {
     $actualMessages = $productPage->getMessagesBlock()->getSuccessMessages();
     \PHPUnit_Framework_Assert::assertContains(self::DUPLICATE_MESSAGE, $actualMessages, 'Wrong duplicated message is displayed.' . "\nExpected: " . self::DUPLICATE_MESSAGE . "\nActual:\n" . implode("\n - ", $actualMessages));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:11,代码来源:AssertProductDuplicateMessage.php

示例4: processAssert

 /**
  * Assert that success message is displayed after product save
  *
  * @param CatalogProductEdit $productPage
  * @return void
  */
 public function processAssert(CatalogProductEdit $productPage)
 {
     $actualMessage = $productPage->getMessagesBlock()->getSuccessMessages();
     \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $actualMessage, 'Wrong success message is displayed.' . "\nExpected: " . self::SUCCESS_MESSAGE . "\nActual: " . $actualMessage);
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:11,代码来源:AssertProductSaveMessage.php

示例5: processAssert

 /**
  * Assert that success message is displayed after product save
  *
  * @param CatalogProductEdit $productPage
  * @return void
  */
 public function processAssert(CatalogProductEdit $productPage)
 {
     $actualMessages = $productPage->getMessagesBlock()->getSuccessMessages();
     $actualMessages = is_array($actualMessages) ? $actualMessages : [$actualMessages];
     \PHPUnit_Framework_Assert::assertContains(self::SUCCESS_MESSAGE, $actualMessages, 'Wrong success message is displayed.' . "\nExpected: " . self::SUCCESS_MESSAGE . "\nActual:\n" . implode("\n - ", $actualMessages));
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:12,代码来源:AssertProductSaveMessage.php


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