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

Provides some test definitions to the trait.

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