function PluginBaseTest::testGetPluginId

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php \Drupal\Tests\Component\Plugin\PluginBaseTest::testGetPluginId()
  2. 9 core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php \Drupal\Tests\Component\Plugin\PluginBaseTest::testGetPluginId()
  3. 8.9.x core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php \Drupal\Tests\Component\Plugin\PluginBaseTest::testGetPluginId()

Tests get plugin id.

@legacy-covers ::getPluginId

Attributes

#[DataProvider('providerTestGetPluginId')]

File

core/tests/Drupal/Tests/Component/Plugin/PluginBaseTest.php, line 25

Class

PluginBaseTest
Tests Drupal\Component\Plugin\PluginBase.

Namespace

Drupal\Tests\Component\Plugin

Code

public function testGetPluginId($plugin_id, $expected) : void {
  $plugin_base = new StubPluginBase([], $plugin_id, []);
  $this->assertEquals($expected, $plugin_base->getPluginId());
}

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