function FormElementHelperTest::testGetElementByName

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php \Drupal\Tests\Core\Form\FormElementHelperTest::testGetElementByName()
  2. 10 core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php \Drupal\Tests\Core\Form\FormElementHelperTest::testGetElementByName()
  3. 11.x core/tests/Drupal/Tests/Core/Form/FormElementHelperTest.php \Drupal\Tests\Core\Form\FormElementHelperTest::testGetElementByName()

Tests the getElementByName() method.

@covers ::getElementByName

@dataProvider getElementByNameProvider

File

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

Class

FormElementHelperTest
Tests the form element helper.

Namespace

Drupal\Tests\Core\Form

Code

public function testGetElementByName($name, $form, $expected) {
    $this->assertSame($expected, FormElementHelper::getElementByName($name, $form));
}

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