You are here

public function PluginIdTest::testCreate in Plugin 8.2

@covers ::create @covers ::__construct

File

tests/src/Unit/Plugin/views/filter/PluginIdTest.php, line 63

Class

PluginIdTest
@coversDefaultClass \Drupal\plugin\Plugin\views\filter\PluginId

Namespace

Drupal\Tests\plugin\Unit\Plugin\views\filter

Code

public function testCreate() {
  $plugin_type_id = 'foo_bar';
  $plugin_id = '';
  $plugin_definition = [
    'id' => $plugin_id,
  ];
  $configuration = [
    'plugin_type_id' => $plugin_type_id,
  ];
  $plugin_type_manager = $this
    ->prophesize(PluginTypeManagerInterface::class);
  $plugin_type_manager
    ->getPluginType($plugin_type_id)
    ->wilLReturn($this->pluginType
    ->reveal());
  $container = $this
    ->prophesize(ContainerInterface::class);
  $container
    ->get('plugin.plugin_type_manager')
    ->willReturn($plugin_type_manager
    ->reveal());
  $this->sut = PluginId::create($container
    ->reveal(), $configuration, $plugin_id, $plugin_definition);
  $this
    ->assertInstanceOf(PluginId::class, $this->sut);
}