Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertBillingAddressSameAsShippingCheckbox.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Checkout\Test\Page\CheckoutOnepage;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertBillingAddressSameAsShippingCheckbox extends AbstractConstraint
16 {
24  public function processAssert(CheckoutOnepage $checkoutOnepage, $billingCheckboxState)
25  {
26  $actualResult = $checkoutOnepage
27  ->getPaymentBlock()
28  ->getSelectedPaymentMethodBlock()
29  ->getBillingBlock()
30  ->getSameAsShippingCheckboxValue();
31 
32  \PHPUnit\Framework\Assert::assertEquals(
33  $billingCheckboxState,
34  $actualResult,
35  '"Same as Shipping" checkbox has wrong value'
36  );
37  }
38 
44  public function toString()
45  {
46  return '"Same as Shipping" checkbox has correct value.';
47  }
48 }