You are here

public function WebAssert::statusMessageNotExists in Drupal 10

Asserts that a status message does not exist.

Parameters

string|null $type: The optional message type: status, error, or warning.

File

core/tests/Drupal/Tests/WebAssert.php, line 1046

Class

WebAssert
Defines a class with methods for asserting presence of elements during tests.

Namespace

Drupal\Tests

Code

public function statusMessageNotExists(string $type = NULL) : void {
  $selector = $this
    ->buildStatusMessageSelector(NULL, $type);
  try {
    $this
      ->elementNotExists('xpath', $selector);
  } catch (ExpectationException $e) {
    Assert::fail($e
      ->getMessage());
  }
}