Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
functional
tests
app
Magento
Checkout
Test
Constraint
AssertDiscountInShoppingCart.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Checkout\Test\Constraint
;
8
9
use
Magento\Checkout\Test\Fixture\Cart
;
10
use Magento\Checkout\Test\Page\CheckoutCart;
11
use Magento\Mtf\Constraint\AbstractConstraint;
12
18
class
AssertDiscountInShoppingCart
extends
AbstractConstraint
19
{
27
public
function
processAssert
(
CheckoutCart
$checkoutCart, Cart
$cart
)
28
{
29
$checkoutCart->open();
30
$checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
31
\PHPUnit\Framework\Assert::assertEquals(
32
number_format(
$cart
->getDiscount(), 2),
33
$checkoutCart->getTotalsBlock()->getDiscount(),
34
'Discount amount in the shopping cart not equals to discount amount from fixture.'
35
);
36
}
37
43
public
function
toString
()
44
{
45
return
'Discount in the shopping cart equals to expected discount amount from data set.'
;
46
}
47
}
Magento\Checkout\Test\Constraint\AssertDiscountInShoppingCart
Definition:
AssertDiscountInShoppingCart.php:18
Magento\Checkout\Test\Fixture\Cart
Definition:
Items.php:7
Magento\Checkout\Model\Cart
Definition:
CartInterface.php:6
Magento\Checkout\Test\Constraint\AssertDiscountInShoppingCart\toString
toString()
Definition:
AssertDiscountInShoppingCart.php:43
Magento\Checkout\Test\Constraint
Definition:
AssertAddedProductToCartSuccessMessage.php:7
$cart
$cart
Definition:
quote_with_bundle_and_options.php:47
Magento\Checkout\Test\Constraint\AssertDiscountInShoppingCart\processAssert
processAssert(CheckoutCart $checkoutCart, Cart $cart)
Definition:
AssertDiscountInShoppingCart.php:27