function BasicDeriverTest::testCreate in Payment 8.2
@covers ::create @covers ::__construct
File
- tests/
src/ Unit/ Plugin/ Payment/ Method/ BasicDeriverTest.php, line 57
Class
- BasicDeriverTest
- @coversDefaultClass \Drupal\payment\Plugin\Payment\Method\BasicDeriver
Namespace
Drupal\Tests\payment\Unit\Plugin\Payment\MethodCode
function testCreate() {
$entity_type_manager = $this
->createMock(EntityTypeManagerInterface::class);
$entity_type_manager
->expects($this
->once())
->method('getStorage')
->with('payment_method_configuration')
->willReturn($this->paymentMethodConfigurationStorage);
$container = $this
->createMock(ContainerInterface::class);
$map = array(
array(
'entity_type.manager',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$entity_type_manager,
),
array(
'plugin.manager.payment.method_configuration',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->paymentMethodConfigurationManager,
),
);
$container
->expects($this
->any())
->method('get')
->willReturnMap($map);
$sut = BasicDeriver::create($container, [], '', []);
$this
->assertInstanceOf(BasicDeriver::class, $sut);
}