You are here

protected function ShipmentAdminTest::assertRenderedAddressInRegion in Commerce Shipping 8.2

Asserts that the given address is rendered on the page.

@todo use assertRenderedAddress after https://www.drupal.org/project/commerce/issues/3117251

Parameters

array $address: The address.

\Behat\Mink\Element\NodeElement $element: The parent element holding the address.

1 call to ShipmentAdminTest::assertRenderedAddressInRegion()
ShipmentAdminTest::testInlineEntityFormIntegration in tests/src/FunctionalJavascript/ShipmentAdminTest.php
Tests using inline_entity_form to manage an order's shipments.

File

tests/src/FunctionalJavascript/ShipmentAdminTest.php, line 733

Class

ShipmentAdminTest
Tests the shipment admin UI.

Namespace

Drupal\Tests\commerce_shipping\FunctionalJavascript

Code

protected function assertRenderedAddressInRegion(array $address, NodeElement $element) {
  $address_text = $element
    ->find('css', 'p.address')
    ->getText();
  foreach ($address as $property => $value) {
    if ($property === 'country_code') {
      $value = $this->countryList[$value];
    }
    $this
      ->assertContains($value, $address_text);
  }
}