You are here

public function WebAssert::addressMatches in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/WebAssert.php \Behat\Mink\WebAssert::addressMatches()

Checks that current session address matches regex.

Parameters

string $regex:

Throws

ExpectationException

File

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

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function addressMatches($regex) {
  $actual = $this
    ->getCurrentUrlPath();
  $message = sprintf('Current page "%s" does not match the regex "%s".', $actual, $regex);
  $this
    ->assert((bool) preg_match($regex, $actual), $message);
}