function LazyPluginCollectionTestBase::getPluginDefinitions

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php \Drupal\Tests\Core\Plugin\LazyPluginCollectionTestBase::getPluginDefinitions()
  2. 10 core/tests/Drupal/Tests/Core/Plugin/LazyPluginCollectionTestBase.php \Drupal\Tests\Core\Plugin\LazyPluginCollectionTestBase::getPluginDefinitions()
  3. 11.x 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 120

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;
}

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