You are here

function AddPaymentMethodConfigurationTest::testCreate in Payment 8.2

@covers ::create @covers ::__construct

File

tests/src/Unit/Controller/AddPaymentMethodConfigurationTest.php, line 102

Class

AddPaymentMethodConfigurationTest
@coversDefaultClass \Drupal\payment\Controller\AddPaymentMethodConfiguration

Namespace

Drupal\Tests\payment\Unit\Controller

Code

function testCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = [
    [
      'current_user',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->currentUser,
    ],
    [
      'entity.form_builder',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->entityFormBuilder,
    ],
    [
      'entity_type.manager',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->entityTypeManager,
    ],
    [
      'plugin.manager.payment.method_configuration',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->paymentMethodConfigurationManager,
    ],
    [
      'request_stack',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->requestStack,
    ],
    [
      'string_translation',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->stringTranslation,
    ],
  ];
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $sut = AddPaymentMethodConfiguration::create($container);
  $this
    ->assertInstanceOf(AddPaymentMethodConfiguration::class, $sut);
}