You are here

public function CustomerProfileAlterTest::testApplies in Drupal Commerce Connector for AvaTax 8

@covers ::applies @dataProvider appliesDataProvider

File

tests/src/Unit/CustomerProfileAlterTest.php, line 33

Class

CustomerProfileAlterTest
@group commerce_avatax @coversDefaultClass \Drupal\commerce_avatax\CustomerProfileAlter

Namespace

Drupal\Tests\commerce_avatax\Unit

Code

public function testApplies(bool $enabled, string $profile_scope, bool $expected_applies) {
  $sut = $this
    ->getCustomerProfileAlter([
    'address_validation' => [
      'enable' => $enabled,
    ],
  ]);
  $inline_form = [
    '#profile_scope' => $profile_scope,
  ];
  $this
    ->assertEquals($expected_applies, $sut
    ->applies($inline_form, new FormState()));
}