function DiscoveryCachedTraitTest::providerGetDefinition

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryCachedTraitTest::providerGetDefinition()
  2. 10 core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryCachedTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryCachedTraitTest::providerGetDefinition()
  3. 11.x 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',
        ],
    ];
}

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