You are here

public function DiscoveryCachedTraitTest::providerGetDefinition in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryCachedTraitTest::providerGetDefinition()

Data provider for testGetDefinition().

Return value

array

  • Expected result from getDefinition().
  • Cached definitions to be placed into self::$definitions
  • Definitions to be returned by getDefinitions().
  • Plugin name to query for.

File

core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php, line 23

Class

DiscoveryCachedTraitTest
@coversDefaultClass \Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait @uses \Drupal\Component\Plugin\Discovery\DiscoveryTrait @group Plugin

Namespace

Drupal\Tests\Component\Plugin\Discovery

Code

public function providerGetDefinition() {
  return [
    [
      'definition',
      [],
      [
        'plugin_name' => 'definition',
      ],
      'plugin_name',
    ],
    [
      'definition',
      [
        'plugin_name' => 'definition',
      ],
      [],
      'plugin_name',
    ],
    [
      NULL,
      [
        'plugin_name' => 'definition',
      ],
      [],
      'bad_plugin_name',
    ],
  ];
}