function DiscoveryTraitTest::providerDoGetDefinition

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryTraitTest::providerDoGetDefinition()
  2. 10 core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryTraitTest::providerDoGetDefinition()
  3. 11.x core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php \Drupal\Tests\Component\Plugin\Discovery\DiscoveryTraitTest::providerDoGetDefinition()

Data provider for testDoGetDefinition().

Return value

array

  • Expected plugin definition.
  • Plugin definition array, to pass to doGetDefinition().
  • Plugin ID to get, passed to doGetDefinition().

File

core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php, line 22

Class

DiscoveryTraitTest
@group Plugin @coversDefaultClass \Drupal\Component\Plugin\Discovery\DiscoveryTrait

Namespace

Drupal\Tests\Component\Plugin\Discovery

Code

public function providerDoGetDefinition() {
    return [
        [
            '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.