Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. WebAssert.php

function WebAssert::pageTextNotMatches

Checks that current page text does not match regex.

Parameters

string $regex:

Return value

void

Throws

ResponseTextException

File

vendor/behat/mink/src/WebAssert.php, line 341

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function pageTextNotMatches(string $regex) {
    $actual = $this->session
        ->getPage()
        ->getText();
    $message = sprintf('The pattern %s was found in the text of the current page, but it should not.', $regex);
    $this->assertResponseText(!preg_match($regex, $actual), $message);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal