function PluginWithFormsTraitTest::testGetFormClass

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

@covers ::getFormClass @covers ::hasFormClass @dataProvider providerGetFormClass

File

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

Class

PluginWithFormsTraitTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Plugin%21PluginWithFormsTrait.php/trait/PluginWithFormsTrait/10" 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 testGetFormClass(PluginWithFormsInterface $block_plugin, $operation, $expected_class) : void {
    $this->assertSame($expected_class, $block_plugin->getFormClass($operation));
    $this->assertSame($expected_class !== NULL, $block_plugin->hasFormClass($operation));
}

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