function ListPluginTypesTest::testCreate in Plugin 8.2
@covers ::create @covers ::__construct
File
- tests/
src/ Unit/ Controller/ ListPluginTypesTest.php, line 86
Class
- ListPluginTypesTest
- @coversDefaultClass \Drupal\plugin\Controller\ListPluginTypes
Namespace
Drupal\Tests\plugin\Unit\ControllerCode
function testCreate() {
$container = $this
->createMock(ContainerInterface::class);
$map = [
[
'module_handler',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->moduleHandler,
],
[
'plugin.plugin_type_manager',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->pluginTypeManager,
],
[
'string_translation',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->stringTranslation,
],
];
$container
->expects($this
->any())
->method('get')
->willReturnMap($map);
$sut = ListPluginTypes::create($container);
$this
->assertInstanceOf(ListPluginTypes::class, $sut);
}