function ContextualLinkManagerTest::testProcessDefinitionWithoutRoute

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php \Drupal\Tests\Core\Menu\ContextualLinkManagerTest::testProcessDefinitionWithoutRoute()
  2. 10 core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php \Drupal\Tests\Core\Menu\ContextualLinkManagerTest::testProcessDefinitionWithoutRoute()
  3. 11.x core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php \Drupal\Tests\Core\Menu\ContextualLinkManagerTest::testProcessDefinitionWithoutRoute()

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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.