function CategorizingPluginManager::getDefinitions

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManager::getDefinitions()
  2. 8.9.x core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManager::getDefinitions()
  3. 11.x core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php \Drupal\Tests\Core\Plugin\CategorizingPluginManager::getDefinitions()

Provides some test definitions to the trait.

Overrides DefaultPluginManager::getDefinitions

File

core/tests/Drupal/Tests/Core/Plugin/CategorizingPluginManagerTraitTest.php, line 137

Class

CategorizingPluginManager
Class that allows testing the trait.

Namespace

Drupal\Tests\Core\Plugin

Code

public function getDefinitions() {
    return [
        'cucumber' => [
            'label' => 'cucumber',
            'category' => 'vegetables',
        ],
        'apple' => [
            'label' => 'apple',
            'category' => 'fruits',
        ],
        'mango' => [
            'label' => 'mango',
            'category' => 'fruits',
        ],
    ];
}

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