function AssertContentTrait::xpath
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::xpath()
- 10 core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::xpath()
- 9 core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::xpath()
- 8.9.x core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::xpath()
Performs an xpath search on the contents of the internal browser.
The search is relative to the root element (HTML tag normally) of the page.
Parameters
string $xpath: The xpath string to use in the search.
array $arguments: 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
\SimpleXMLElement[]|false The return value of the xpath search or FALSE on failure. For details on the xpath string format and return values see the SimpleXML documentation.
Deprecated
in drupal:11.5.0 and is removed from drupal:13.0.0. Use \Drupal\KernelTests\AssertContentTrait::getSimpleXmlElementsByXpath() instead.
See also
https://www.drupal.org/node/3589621
File
-
core/
tests/ Drupal/ KernelTests/ AssertContentTrait.php, line 206
Class
- AssertContentTrait
- Provides test methods to assert content.
Namespace
Drupal\KernelTestsCode
protected function xpath(string $xpath, array $arguments = []) : array|false {
@trigger_error(__METHOD__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Use \\Drupal\\KernelTests\\AssertContentTrait::getSimpleXmlElementsByXpath() instead. See https://www.drupal.org/node/3589621', E_USER_DEPRECATED);
return $this->getSimpleXmlElementsByXpath($xpath, $arguments);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.