You are here

protected function LazyPluginCollectionTestBase::getPluginDefinitions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 123
Contains \Drupal\Tests\Core\Plugin\LazyPluginCollectionTestBase.

Class

LazyPluginCollectionTestBase
Provides a base class for plugin collection tests.

Namespace

Drupal\Tests\Core\Plugin

Code

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