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


PHP CatalogProductView::getMessagesBlock方法代码示例

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


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

示例1: addProductToCart

 /**
  * Add product to cart.
  *
  * @param CatalogProductSimple $product
  * @param int $qty
  * @return void
  */
 protected function addProductToCart(CatalogProductSimple $product, $qty)
 {
     $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $productView = $this->catalogProductView->getViewBlock();
     $productView->fillOptions($product);
     $productView->setQty($qty);
     $productView->clickAddToCart();
     $this->catalogProductView->getMessagesBlock()->waitSuccessMessage();
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:16,代码来源:UpdateShoppingCartTest.php

示例2: processAssert

 /**
  * Assert that product can be added to active gift registry from shopping cart.
  *
  * @param CatalogProductView $catalogProductView
  * @param CheckoutCart $checkoutCart
  * @param InjectableFixture $product
  * @param GiftRegistry $giftRegistry
  * @param GiftRegistryItems $giftRegistryItems
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, CheckoutCart $checkoutCart, InjectableFixture $product, GiftRegistry $giftRegistry, GiftRegistryItems $giftRegistryItems, BrowserInterface $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->addToCart($product);
     $catalogProductView->getMessagesBlock()->waitSuccessMessage();
     $checkoutCart->open();
     $checkoutCart->getGiftRegistryBlock()->addToGiftRegistry($giftRegistry);
     \PHPUnit_Framework_Assert::assertTrue($giftRegistryItems->getGiftRegistryItemsBlock()->isProductInGrid($product), "Product can not be added to active gift registry '{$giftRegistry->getTitle()}' from shopping cart.");
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:20,代码来源:AssertGiftRegistryActiveInShoppingCart.php

示例3: run

 /**
  * Add products to the cart.
  *
  * @return void
  */
 public function run()
 {
     // Ensure that shopping cart is empty
     $this->checkoutCart->open()->getCartBlock()->clearShoppingCart();
     foreach ($this->products as $product) {
         $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
         $this->catalogProductView->getViewBlock()->addToCart($product);
         $this->catalogProductView->getMessagesBlock()->waitSuccessMessage();
     }
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:15,代码来源:AddProductsToTheCartStep.php

示例4: processAssert

 /**
  * Assert that product is displayed in cross-sell section for customer segment.
  *
  * @param Browser $browser
  * @param Customer $customer
  * @param CheckoutCart $checkoutCart
  * @param CatalogProductSimple $product
  * @param CatalogProductView $catalogProductView
  * @param CustomerAccountLogout $customerAccountLogout
  * @param InjectableFixture[] $promotedProducts
  * @return void
  */
 public function processAssert(Browser $browser, Customer $customer, CheckoutCart $checkoutCart, CatalogProductSimple $product, CatalogProductView $catalogProductView, CustomerAccountLogout $customerAccountLogout, array $promotedProducts)
 {
     // Create customer, logout and login to frontend
     $customer->persist();
     $customerAccountLogout->open();
     $this->objectManager->create('Mage\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     // Clear cart
     $checkoutCart->open();
     $checkoutCart->getCartBlock()->clearShoppingCart();
     // Check display cross sell products
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getViewBlock()->addToCart($product);
     $catalogProductView->getMessagesBlock()->waitSuccessMessage();
     $checkoutCart->open();
     $errors = [];
     foreach ($promotedProducts as $promotedProduct) {
         if (!$checkoutCart->getCrosssellBlock()->getItemBlock($promotedProduct)->isVisible()) {
             $errors[] = "Product '{$promotedProduct->getName()}' is absent in cross-sell section.";
         }
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, implode(" ", $errors));
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:34,代码来源:AssertProductCrossSellsForCustomerSegment.php

示例5: processAssert

 /**
  * Assert that product success add message is present on CatalogProductView page.
  *
  * @param CatalogProductView $catalogProductView
  * @param InjectableFixture $product
  * @return bool
  */
 public function processAssert(CatalogProductView $catalogProductView, InjectableFixture $product)
 {
     $successMessage = sprintf(self::SUCCESS_MESSAGE, $product->getName());
     $actualMessage = $catalogProductView->getMessagesBlock()->getSuccessMessages();
     \PHPUnit_Framework_Assert::assertEquals($successMessage, $actualMessage);
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:13,代码来源:AssertProductCompareSuccessAddMessage.php

示例6: processAssert

 /**
  * Assert message is appeared on "Compare Products" page.
  *
  * @param CatalogProductView $catalogProductView
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView)
 {
     \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $catalogProductView->getMessagesBlock()->getSuccessMessages());
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:10,代码来源:AssertProductCompareSuccessRemoveAllProductsMessage.php


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