You are here

public function ContextualLinkManagerTest::testProcessDefinitionWithoutRoute in Drupal 8

Tests processDefinition() by passing a plugin definition without a route.

See also

\Drupal\Core\Menu\ContextualLinkManager::processDefinition()

File

core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php, line 210

Class

ContextualLinkManagerTest
@coversDefaultClass \Drupal\Core\Menu\ContextualLinkManager @group Menu

Namespace

Drupal\Tests\Core\Menu

Code

public function testProcessDefinitionWithoutRoute() {
  $definition = [
    'class' => '\\Drupal\\Core\\Menu\\ContextualLinkDefault',
    'group' => 'example',
    'id' => 'test_plugin',
  ];
  $this
    ->expectException(PluginException::class);
  $this->contextualLinkManager
    ->processDefinition($definition, 'test_plugin');
}