You are here

protected function LinkFieldUITest::getFieldHtml in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/link/tests/src/Functional/LinkFieldUITest.php \Drupal\Tests\link\Functional\LinkFieldUITest::getFieldHtml()
  2. 9 core/modules/link/tests/src/Functional/LinkFieldUITest.php \Drupal\Tests\link\Functional\LinkFieldUITest::getFieldHtml()

Returns the raw HTML for the given field.

Parameters

$field_name: The name of the field for which to return the HTML.

Return value

string The raw HTML.

File

core/modules/link/tests/src/Functional/LinkFieldUITest.php, line 251

Class

LinkFieldUITest
Tests link field UI functionality.

Namespace

Drupal\Tests\link\Functional

Code

protected function getFieldHtml($field_name) {
  $css_id = Html::cleanCssIdentifier('edit-field-' . $field_name . '-wrapper');
  return $this
    ->xpath('//*[@id=:id]', [
    ':id' => $css_id,
  ])[0]
    ->getHtml();
}