protected function NameWidgetTest::constructFieldXpathByTypeAndAttribute in Name Field 8
Helper: Constructs an XPath for the given set of attributes and value.
Parameters
string $type: Type of element.
string $attribute: Field attributes.
string $value: Value of field.
Return value
string XPath for specified values.
1 call to NameWidgetTest::constructFieldXpathByTypeAndAttribute()
- NameWidgetTest::assertFieldByTypeAndName in tests/src/ Functional/ NameWidgetTest.php 
- Asserts that the given field exists.
File
- tests/src/ Functional/ NameWidgetTest.php, line 363 
Class
- NameWidgetTest
- Various tests on creating a name widget on a node.
Namespace
Drupal\Tests\name\FunctionalCode
protected function constructFieldXpathByTypeAndAttribute($type, $attribute, $value) {
  $xpath = '//' . $type . '[@' . $attribute . '=:value]';
  return $this
    ->buildXPathQuery($xpath, [
    ':value' => $value,
  ]);
}