You are here

public function AddressValidationTest::addressesData in Drupal Commerce Connector for AvaTax 8

The test address data.

Return value

\Generator The test data.

File

tests/src/Kernel/AddressValidationTest.php, line 77

Class

AddressValidationTest
Tests address resolving and validation.

Namespace

Drupal\Tests\commerce_avatax\Kernel

Code

public function addressesData() : \Generator {
  (yield [
    [
      'address_line1' => '2000 Main St',
      'address_line2' => '',
      'locality' => 'Irvine',
      'administrative_area' => 'CA',
      'postal_code' => '92614-7202',
      'country_code' => 'US',
    ],
    __DIR__ . '/../../fixtures/irvine.json',
    TRUE,
    TRUE,
    [],
    [],
    [],
  ]);
  (yield [
    [
      'address_line1' => '2000 Main Stree',
      'address_line2' => '',
      'locality' => 'Irvine',
      'administrative_area' => 'CO',
      'postal_code' => '92610',
      'country_code' => 'US',
    ],
    __DIR__ . '/../../fixtures/irvine_suggestion.json',
    TRUE,
    TRUE,
    [
      'address_line1' => '2000 Main St',
      'administrative_area' => 'CA',
      'postal_code' => '92614-7202',
    ],
    [],
    [
      'address_line1' => '2000 Main St',
      'address_line2' => '',
      'locality' => 'Irvine',
      'administrative_area' => 'CA',
      'postal_code' => '92614-7202',
      'country_code' => 'US',
    ],
  ]);
  (yield [
    [
      'address_line1' => '2000 Main St',
      'address_line2' => '',
      'locality' => 'Irvine',
      'administrative_area' => 'CA',
      'postal_code' => '92614',
      'country_code' => 'US',
    ],
    __DIR__ . '/../../fixtures/irvine_postal_code_suggestion.json',
    FALSE,
    TRUE,
    [],
    [],
    [],
  ]);
  (yield [
    [
      'address_line1' => '2000 Main St',
      'address_line2' => '',
      'locality' => 'Irvine',
      'administrative_area' => 'CA',
      'postal_code' => '92614',
      'country_code' => 'US',
    ],
    __DIR__ . '/../../fixtures/irvine_postal_code_suggestion.json',
    TRUE,
    TRUE,
    [
      'postal_code' => '92614-7202',
    ],
    [],
    [
      'address_line1' => '2000 Main St',
      'address_line2' => '',
      'locality' => 'Irvine',
      'administrative_area' => 'CA',
      'postal_code' => '92614-7202',
      'country_code' => 'US',
    ],
  ]);
  (yield [
    [
      'address_line1' => '20000 Main Street',
      'address_line2' => '',
      'locality' => 'Irvine',
      'administrative_area' => 'CA',
      'postal_code' => '92614',
      'country_code' => 'US',
    ],
    __DIR__ . '/../../fixtures/irvine_error.json',
    TRUE,
    FALSE,
    [],
    [
      0 => 'address_line1',
    ],
    [],
  ]);
}