You are here

protected function ProfileFieldCopyTest::assertRenderedAddress in Commerce Shipping 8.2

Asserts that the given address is rendered on the page.

Parameters

array $address: The address.

string $profile_id: The parent profile ID.

Overrides CommerceWebDriverTestBase::assertRenderedAddress

5 calls to ProfileFieldCopyTest::assertRenderedAddress()
ProfileFieldCopyTest::testAdmin in tests/src/FunctionalJavascript/ProfileFieldCopyTest.php
Tests the admin UI.
ProfileFieldCopyTest::testAdminWithFields in tests/src/FunctionalJavascript/ProfileFieldCopyTest.php
Tests the admin UI with additional billing fields.
ProfileFieldCopyTest::testCheckout in tests/src/FunctionalJavascript/ProfileFieldCopyTest.php
Tests checkout.
ProfileFieldCopyTest::testCheckoutWithFields in tests/src/FunctionalJavascript/ProfileFieldCopyTest.php
Tests checkout with additional billing fields.
ProfileFieldCopyTest::testCheckoutWithMultipleGateways in tests/src/FunctionalJavascript/ProfileFieldCopyTest.php
Tests checkout with multiple payment gateways.

File

tests/src/FunctionalJavascript/ProfileFieldCopyTest.php, line 721

Class

ProfileFieldCopyTest
Tests the "Shipping information" checkout pane.

Namespace

Drupal\Tests\commerce_shipping\FunctionalJavascript

Code

protected function assertRenderedAddress(array $address, $profile_id = NULL) {
  $parent_class = $profile_id ? '.profile--' . $profile_id : '.profile';
  $page = $this
    ->getSession()
    ->getPage();
  $address_text = $page
    ->find('css', $parent_class . ' p.address')
    ->getText();
  foreach ($address as $property => $value) {
    if ($property == 'country_code') {
      $value = $this->countryList[$value];
    }
    $this
      ->assertContains($value, $address_text);
  }
}