You are here

public function PaymentMethodConfigurationAccessControlHandlerTest::testCreateInstance in Payment 8.2

@covers ::createInstance @covers ::__construct

File

tests/src/Unit/Entity/PaymentMethodConfiguration/PaymentMethodConfigurationAccessControlHandlerTest.php, line 67

Class

PaymentMethodConfigurationAccessControlHandlerTest
@coversDefaultClass \Drupal\payment\Entity\PaymentMethodConfiguration\PaymentMethodConfigurationAccessControlHandler

Namespace

Drupal\Tests\payment\Unit\Entity\PaymentMethodConfiguration

Code

public function testCreateInstance() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = [
    [
      'module_handler',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->moduleHandler,
    ],
  ];
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $entity_type = $this
    ->createMock(EntityTypeInterface::class);
  $handler = PaymentMethodConfigurationAccessControlHandler::createInstance($container, $entity_type);
  $this
    ->assertInstanceOf(PaymentMethodConfigurationAccessControlHandler::class, $handler);
}