本文整理汇总了PHP中Magento\Checkout\Test\Page\CheckoutCart::getMessagesBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP CheckoutCart::getMessagesBlock方法的具体用法?PHP CheckoutCart::getMessagesBlock怎么用?PHP CheckoutCart::getMessagesBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Checkout\Test\Page\CheckoutCart
的用法示例。
在下文中一共展示了CheckoutCart::getMessagesBlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test
/**
* Run test add products to shopping cart
*
* @param string $products
* @param int $deletedProductIndex
* @return array
*/
public function test($products, $deletedProductIndex)
{
// Preconditions
$products = $this->prepareProducts($products);
$this->cartPage->open();
$this->cartPage->getCartBlock()->clearShoppingCart();
// Steps
$this->addToCart($products);
$this->cartPage->getMessagesBlock()->waitSuccessMessage();
$this->removeProduct($products[$deletedProductIndex]);
$deletedProduct = $products[$deletedProductIndex];
unset($products[$deletedProductIndex]);
return ['products' => $products, 'deletedProduct' => $deletedProduct];
}
示例2: processAssert
/**
* Assert that success message is correct.
*
* @param CheckoutCart $checkoutCart
*/
public function processAssert(CheckoutCart $checkoutCart)
{
\PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $checkoutCart->getMessagesBlock()->getSuccessMessage(), 'Success message about Express Checkout cancellation is not present or wrong.');
}
示例3: processAssert
/**
* Assert success message is appeared on Shopping Cart page
*
* @param CheckoutCart $checkoutCart
* @param FixtureInterface $product
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, FixtureInterface $product)
{
\PHPUnit_Framework_Assert::assertEquals(sprintf(self::SUCCESS_MESSAGE, $product->getName()), $checkoutCart->getMessagesBlock()->getSuccessMessage());
}