You are here

public function TaxTypePluginTest::testCustomerCodeAnonymous in Drupal Commerce Connector for AvaTax 8

Test that the correct customerCode is sent for anonymous users.

File

tests/src/Kernel/TaxTypePluginTest.php, line 414

Class

TaxTypePluginTest
Tests the tax type plugin.

Namespace

Drupal\Tests\commerce_avatax\Kernel

Code

public function testCustomerCodeAnonymous() {
  $avatax_lib = $this->container
    ->get('commerce_avatax.avatax_lib');
  $this->order
    ->setEmail('');
  $request_body = $avatax_lib
    ->prepareTransactionsCreate($this->order);
  $this
    ->assertEquals('anonymous-' . $this->order
    ->id(), $request_body['customerCode']);
}