You are here

public function FormElementHelperTest::testGetElementTitle in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php \Drupal\Tests\Core\Form\FormElementHelperTest::testGetElementTitle()
  2. 9 core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php \Drupal\Tests\Core\Form\FormElementHelperTest::testGetElementTitle()

Tests the getElementTitle() method.

@covers ::getElementTitle

@dataProvider getElementTitleProvider

File

core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php, line 110

Class

FormElementHelperTest
Tests the form element helper.

Namespace

Drupal\Tests\Core\Form

Code

public function testGetElementTitle($name, $form, $expected) {
  $element = FormElementHelper::getElementByName($name, $form);
  $this
    ->assertSame($expected, FormElementHelper::getElementTitle($element));
}