You are here

function ListPluginsTest::testCreate in Plugin 8.2

@covers ::create @covers ::__construct

File

tests/src/Unit/Controller/ListPluginsTest.php, line 90

Class

ListPluginsTest
@coversDefaultClass \Drupal\plugin\Controller\ListPlugins

Namespace

Drupal\Tests\plugin\Unit\Controller

Code

function testCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = [
    [
      'class_resolver',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->classResolver,
    ],
    [
      'module_handler',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->moduleHandler,
    ],
    [
      'string_translation',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->stringTranslation,
    ],
  ];
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $sut = ListPlugins::create($container);
  $this
    ->assertInstanceOf(ListPlugins::class, $sut);
}