function WebAssert::statusMessageExists
Same name in other branches
- 9 core/tests/Drupal/Tests/WebAssert.php \Drupal\Tests\WebAssert::statusMessageExists()
- 10 core/tests/Drupal/Tests/WebAssert.php \Drupal\Tests\WebAssert::statusMessageExists()
Asserts that a status message exists.
Parameters
string|null $type: The optional message type: status, error, or warning.
File
-
core/
tests/ Drupal/ Tests/ WebAssert.php, line 820
Class
- WebAssert
- Defines a class with methods for asserting presence of elements during tests.
Namespace
Drupal\TestsCode
public function statusMessageExists(?string $type = NULL) : void {
$selector = $this->buildStatusMessageSelector(NULL, $type);
try {
$this->elementExists('xpath', $selector);
} catch (ExpectationException $e) {
Assert::fail($e->getMessage());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.