You are here

public function DiscoveryCachedTraitTest::providerGetDefinition in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 28
Contains \Drupal\Tests\Component\Plugin\Discovery\DiscoveryCachedTraitTest.

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 array(
    [
      'definition',
      [],
      [
        'plugin_name' => 'definition',
      ],
      'plugin_name',
    ],
    [
      'definition',
      [
        'plugin_name' => 'definition',
      ],
      [],
      'plugin_name',
    ],
    [
      NULL,
      [
        'plugin_name' => 'definition',
      ],
      [],
      'bad_plugin_name',
    ],
  );
}