function PaymentFormConfigurationFormTest::testCreate in Payment 8.2
@covers ::create @covers ::__construct
File
- modules/
payment_form/ tests/ src/ Unit/ Plugin/ Payment/ Type/ PaymentFormConfigurationFormTest.php, line 133
Class
- PaymentFormConfigurationFormTest
- @coversDefaultClass \Drupal\payment_form\Plugin\Payment\Type\PaymentFormConfigurationForm
Namespace
Drupal\Tests\payment_form\Unit\Plugin\Payment\TypeCode
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 = [
[
'config.factory',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->configFactory,
],
[
'plugin.manager.payment.method',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->paymentMethodManager,
],
[
'plugin.plugin_type_manager',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$plugin_type_manager
->reveal(),
],
[
'string_translation',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->stringTranslation,
],
];
$container
->expects($this
->any())
->method('get')
->willReturnMap($map);
$sut = PaymentFormConfigurationForm::create($container);
$this
->assertInstanceOf(PaymentFormConfigurationForm::class, $sut);
}