public function AddressValidationTest::testvalidateAddress in Drupal Commerce Connector for AvaTax 8
@covers \Drupal\commerce_avatax\AvataxLib::validateAddress @dataProvider addressesData
File
- tests/
src/ Kernel/ AddressValidationTest.php, line 57
Class
- AddressValidationTest
- Tests address resolving and validation.
Namespace
Drupal\Tests\commerce_avatax\KernelCode
public function testvalidateAddress(array $address, string $fixture, bool $postal_code_verification, bool $expected_valid, array $expected_fields, array $expected_errors, array $expected_suggestion) {
$this
->config('commerce_avatax.settings')
->set('address_validation.postal_code_match', $postal_code_verification)
->save();
$sut = $this
->createMockedAvataxLib($fixture);
$result = $sut
->validateAddress($address);
$this
->assertEquals($expected_valid, $result['valid']);
$this
->assertEquals($expected_fields, $result['fields']);
$this
->assertEquals($expected_errors, $result['errors']);
$this
->assertEquals($expected_suggestion, $result['suggestion']);
$this
->assertEquals($address, $result['original']);
}