You are here

private function CustomerProfileAlterTest::getCustomerProfileAlter in Drupal Commerce Connector for AvaTax 8

Gets a mocked CustomerProfileAlter object for testing.

Parameters

array $settings: The settings to use.

Return value

\Drupal\commerce_avatax\CustomerProfileAlter The customer profile alter.

2 calls to CustomerProfileAlterTest::getCustomerProfileAlter()
CustomerProfileAlterTest::testAlter in tests/src/Unit/CustomerProfileAlterTest.php
@covers ::alter @dataProvider alterDataProvider
CustomerProfileAlterTest::testApplies in tests/src/Unit/CustomerProfileAlterTest.php
@covers ::applies @dataProvider appliesDataProvider

File

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

Class

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

Namespace

Drupal\Tests\commerce_avatax\Unit

Code

private function getCustomerProfileAlter(array $settings) : CustomerProfileAlter {
  $config = new ImmutableConfig('commerce_avatax.settings', $this
    ->prophesize(StorageInterface::class)
    ->reveal(), $this
    ->prophesize(EventDispatcherInterface::class)
    ->reveal(), $this
    ->prophesize(TypedConfigManagerInterface::class)
    ->reveal());
  $config
    ->initWithData($settings);
  $config_factory = $this
    ->prophesize(ConfigFactoryInterface::class);
  $config_factory
    ->get('commerce_avatax.settings')
    ->willReturn($config);
  $time = $this
    ->prophesize(TimeInterface::class);
  $time
    ->getCurrentTime()
    ->willReturn(time());
  return new CustomerProfileAlter($config_factory
    ->reveal(), $this
    ->prophesize(AvataxLibInterface::class)
    ->reveal(), $this
    ->prophesize(CsrfTokenGenerator::class)
    ->reveal(), $time
    ->reveal());
}