You are here

public function CategorizingPluginManager::getDefinitions in Drupal 8

Same name and namespace in other branches
  1. 9 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 128
Contains \Drupal\Tests\Core\Plugin\CategorizingPluginManagerTraitTest.

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',
    ],
  ];
}