You are here

protected function LazyPluginCollectionTestBase::getPluginDefinitions in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php \Drupal\Tests\Core\Plugin\LazyPluginCollectionTestBase::getPluginDefinitions()

Returns some example plugin definitions.

Return value

array The example plugin definitions.

4 calls to LazyPluginCollectionTestBase::getPluginDefinitions()
DefaultLazyPluginCollectionTest::testHas in core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php
@covers ::has
DefaultSingleLazyPluginCollectionTest::setupPluginCollection in core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php
Sets up the default plugin collection.
LazyPluginCollectionTestBase::setUp in core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php
LazyPluginCollectionTestBase::setupPluginCollection in core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php
Sets up the default plugin collection.

File

core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php, line 119

Class

LazyPluginCollectionTestBase
Provides a base class for plugin collection tests.

Namespace

Drupal\Tests\Core\Plugin

Code

protected function getPluginDefinitions() {
  $definitions = [
    'apple' => [
      'id' => 'apple',
      'label' => 'Apple',
      'color' => 'green',
      'class' => 'Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\Apple',
      'provider' => 'plugin_test',
    ],
    'banana' => [
      'id' => 'banana',
      'label' => 'Banana',
      'color' => 'yellow',
      'uses' => [
        'bread' => 'Banana bread',
      ],
      'class' => 'Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\Banana',
      'provider' => 'plugin_test',
    ],
    'cherry' => [
      'id' => 'cherry',
      'label' => 'Cherry',
      'color' => 'red',
      'class' => 'Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\Cherry',
      'provider' => 'plugin_test',
    ],
  ];
  return $definitions;
}