protected function WebformAssertLegacyTrait::buildXPathQuery in Webform 6.x
Same name and namespace in other branches
- 8.5 tests/src/Traits/WebformAssertLegacyTrait.php \Drupal\Tests\webform\Traits\WebformAssertLegacyTrait::buildXPathQuery()
Builds an XPath query.
Builds an XPath query by replacing placeholders in the query by the value of the arguments.
XPath 1.0 (the version supported by libxml2, the underlying XML library used by PHP) doesn't support any form of quotation. This function simplifies the building of XPath expression.
Parameters
string $xpath: An XPath query, possibly with placeholders in the form ':name'.
array $args: An array of arguments with keys in the form ':name' matching the placeholders in the query. The values may be either strings or numeric values.
Return value
string An XPath query with arguments replaced.
1 call to WebformAssertLegacyTrait::buildXPathQuery()
- WebformAssertLegacyTrait::constructFieldXpath in tests/
src/ Traits/ WebformAssertLegacyTrait.php - Helper: Constructs an XPath for the given set of attributes and value.
File
- tests/
src/ Traits/ WebformAssertLegacyTrait.php, line 703
Class
- WebformAssertLegacyTrait
- Provides convenience methods for assertions in browser tests.
Namespace
Drupal\Tests\webform\TraitsCode
protected function buildXPathQuery($xpath, array $args = []) {
return $this
->assertSession()
->buildXPathQuery($xpath, $args);
}