function PaymentMethodBaseTest::testCreate in Payment 8.2
@covers ::create @covers ::__construct
File
- tests/
src/ Unit/ Plugin/ Payment/ Method/ PaymentMethodBaseTest.php, line 60
Class
- PaymentMethodBaseTest
- @coversDefaultClass \Drupal\payment\Plugin\Payment\Method\PaymentMethodBase
Namespace
Drupal\Tests\payment\Unit\Plugin\Payment\MethodCode
function testCreate() {
$container = $this
->createMock(ContainerInterface::class);
$map = [
[
'payment.event_dispatcher',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->eventDispatcher,
],
[
'module_handler',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->moduleHandler,
],
[
'plugin.manager.payment.status',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->paymentStatusManager,
],
[
'token',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->token,
],
];
$container
->expects($this
->any())
->method('get')
->willReturnMap($map);
/** @var \Drupal\payment\Plugin\Payment\Method\PaymentMethodBase $class_name */
$class_name = get_class($this->sut);
$form = $class_name::create($container, [], '', $this->pluginDefinition);
$this
->assertInstanceOf($class_name, $form);
}