You are here

function PaymentReferenceConfigurationFormTest::testCreate in Payment 8.2

@covers ::create @covers ::__construct

File

modules/payment_reference/tests/src/Unit/Plugin/Payment/Type/PaymentReferenceConfigurationFormTest.php, line 132

Class

PaymentReferenceConfigurationFormTest
@coversDefaultClass \Drupal\payment_reference\Plugin\Payment\Type\PaymentReferenceConfigurationForm

Namespace

Drupal\Tests\payment_reference\Unit\Plugin\Payment\Type

Code

function testCreate() {
  $plugin_type_manager = $this
    ->prophesize(PluginTypeManagerInterface::class);
  $plugin_type_manager
    ->getPluginType('plugin_selector')
    ->willReturn($this->pluginSelectorType
    ->reveal());
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = array(
    array(
      'config.factory',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->configFactory,
    ),
    array(
      'plugin.manager.payment.method',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->paymentMethodManager,
    ),
    [
      'plugin.plugin_type_manager',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $plugin_type_manager
        ->reveal(),
    ],
    array(
      'string_translation',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->stringTranslation,
    ),
  );
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $sut = PaymentReferenceConfigurationForm::create($container);
  $this
    ->assertInstanceOf(PaymentReferenceConfigurationForm::class, $sut);
}