You are here

public function PluginTypeConverterTest::testConvertWithUnknownPluginType in Plugin 8.2

@covers ::convert @covers ::doConvert @covers ::validateParameterDefinition @covers ::getConverterDefinitionConstraint @covers ::getConverterDefinition @covers ::getConverterDefinitionKey @covers ::__construct

File

tests/src/Unit/ParamConverter/PluginTypeConverterTest.php, line 144

Class

PluginTypeConverterTest
@coversDefaultClass \Drupal\plugin\ParamConverter\PluginTypeConverter

Namespace

Drupal\Tests\plugin\Unit\ParamConverter

Code

public function testConvertWithUnknownPluginType() {
  $plugin_type_id = 'foo_bar.baz';
  $definition = [
    'plugin.plugin_type' => [],
  ];
  $name = 'foo_bar';
  $defaults = [];
  $this->pluginTypeManager
    ->hasPluginType($plugin_type_id)
    ->willReturn(FALSE);
  $this
    ->assertNull($this->sut
    ->convert($plugin_type_id, $definition, $name, $defaults));
}