Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSalesPrintOrderBillingAddress.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Customer\Test\Fixture\Address;
10 use Magento\Sales\Test\Page\SalesGuestPrint;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertSalesPrintOrderBillingAddress extends AbstractConstraint
17 {
25  public function processAssert(SalesGuestPrint $salesGuestPrint, Address $billingAddress)
26  {
27  $addressRenderer = $this->objectManager->create(
28  \Magento\Customer\Test\Block\Address\Renderer::class,
29  ['address' => $billingAddress, 'type' => 'html']
30  );
31  $expectedBillingAddress = $addressRenderer->render();
32  \PHPUnit\Framework\Assert::assertEquals(
33  $expectedBillingAddress,
34  $salesGuestPrint->getInfoBlock()->getBillingAddress(),
35  "Billing address was printed incorrectly."
36  );
37  }
38 
44  public function toString()
45  {
46  return "Billing address printed correctly.";
47  }
48 }
$billingAddress
Definition: order.php:25
processAssert(SalesGuestPrint $salesGuestPrint, Address $billingAddress)