function PluginWithFormsTraitTest::providerGetFormClass

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php \Drupal\Tests\Core\Plugin\PluginWithFormsTraitTest::providerGetFormClass()
  2. 10 core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php \Drupal\Tests\Core\Plugin\PluginWithFormsTraitTest::providerGetFormClass()
  3. 11.x core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php \Drupal\Tests\Core\Plugin\PluginWithFormsTraitTest::providerGetFormClass()

Return value

array

File

core/tests/Drupal/Tests/Core/Plugin/PluginWithFormsTraitTest.php, line 31

Class

PluginWithFormsTraitTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Plugin%21PluginWithFormsTrait.php/trait/PluginWithFormsTrait/8.9.x" title="Provides a trait with typical behavior for plugins which have forms." class="local">\Drupal\Core\Plugin\PluginWithFormsTrait</a> @group Plugin

Namespace

Drupal\Tests\Core\Plugin

Code

public function providerGetFormClass() {
    $block_plugin_without_forms = new TestClass([], 'block_plugin_without_forms', [
        'provider' => 'block_test',
    ]);
    // A block plugin that has a form defined for the 'poke' operation.
    $block_plugin_with_forms = new TestClass([], 'block_plugin_with_forms', [
        'provider' => 'block_test',
        'forms' => [
            'poke' => static::class,
        ],
    ]);
    return [
        'block plugin without forms, "configure" operation' => [
            $block_plugin_without_forms,
            'configure',
            TestClass::class,
        ],
        'block plugin without forms, "tickle" operation' => [
            $block_plugin_without_forms,
            'tickle',
            NULL,
        ],
        'block plugin without forms, "poke" operation' => [
            $block_plugin_without_forms,
            'poke',
            NULL,
        ],
        'block plugin with forms, "configure" operation' => [
            $block_plugin_with_forms,
            'configure',
            TestClass::class,
        ],
        'block plugin with forms, "tickle" operation' => [
            $block_plugin_with_forms,
            'tickle',
            NULL,
        ],
        'block plugin with forms, "poke" operation' => [
            $block_plugin_with_forms,
            'poke',
            static::class,
        ],
    ];
}

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