function ContextualLinkManagerTest::testProcessDefinitionWithoutGroup

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

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

See also

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

File

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

Class

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

Namespace

Drupal\Tests\Core\Menu

Code

public function testProcessDefinitionWithoutGroup() : void {
    $definition = [
        'class' => '\\Drupal\\Core\\Menu\\ContextualLinkDefault',
        'route_name' => '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.