當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。