本文整理汇总了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();
}
示例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.");
}
示例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();
}
}
示例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));
}
示例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);
}
示例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