function ConfigDeriverTest::testCreate in Payment 8.2
@covers ::create @covers ::__construct
File
- tests/
src/ Unit/ Plugin/ Payment/ Status/ ConfigDeriverTest.php, line 46
Class
- ConfigDeriverTest
- @coversDefaultClass \Drupal\payment\Plugin\Payment\Status\ConfigDeriver
Namespace
Drupal\Tests\payment\Unit\Plugin\Payment\StatusCode
function testCreate() {
$entity_type_manager = $this
->createMock(EntityTypeManagerInterface::class);
$entity_type_manager
->expects($this
->once())
->method('getStorage')
->with('payment_status')
->willReturn($this->paymentStatusStorage);
$container = $this
->createMock(ContainerInterface::class);
$map = array(
array(
'entity_type.manager',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$entity_type_manager,
),
);
$container
->expects($this
->any())
->method('get')
->willReturnMap($map);
$configuration = [];
$plugin_definition = [];
$plugin_id = $this
->randomMachineName();
$sut = ConfigDeriver::create($container, $configuration, $plugin_id, $plugin_definition);
$this
->assertInstanceOf(ConfigDeriver::class, $sut);
}