Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertOrderAddresses.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\Customer\Test\Fixture\Address;
11 
15 class AssertOrderAddresses extends AbstractConstraint
16 {
26  public function processAssert(
27  SalesOrderView $salesOrderView,
28  $orderId,
31  ) {
32 
33  $selectedShippingAddress = $this->objectManager->create(
34  \Magento\Customer\Test\Block\Address\Renderer::class,
35  ['address' => $shippingAddress, 'type' => 'html']
36  )->render();
37 
38  $selectedBillingAddress = $this->objectManager->create(
39  \Magento\Customer\Test\Block\Address\Renderer::class,
40  ['address' => $billingAddress, 'type' => 'html']
41  )->render();
42 
43  $salesOrderView->open(['order_id' => $orderId]);
44  $orderBillingAddress = $salesOrderView->getAddressesBlock()->getCustomerBillingAddress();
45  $orderShippingAddress = $salesOrderView->getAddressesBlock()->getCustomerShippingAddress();
46 
47  \PHPUnit\Framework\Assert::assertTrue(
48  $selectedBillingAddress == $orderBillingAddress && $selectedShippingAddress == $orderShippingAddress,
49  'Billing and shipping addresses from the address book and from the order page are not the same.'
50  );
51  }
52 
58  public function toString()
59  {
60  return 'Billing and shipping addresses from the address book and from the order page are the same.';
61  }
62 }
processAssert(SalesOrderView $salesOrderView, $orderId, Address $shippingAddress, Address $billingAddress)
$billingAddress
Definition: order.php:25
$shippingAddress
Definition: order.php:40