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

Breadcrumb

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

function ExceptionMessageMatchesRegularExpression::matches

Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.

Throws

\PHPUnit\Framework\Exception

Exception

Overrides Constraint::matches

File

vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageMatchesRegularExpression.php, line 43

Class

ExceptionMessageMatchesRegularExpression
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Framework\Constraint

Code

protected function matches(mixed $other) : bool {
    $match = @preg_match($this->regularExpression, (string) $other);
    if ($match === false) {
        throw new \PHPUnit\Framework\Exception(sprintf('Invalid expected exception message regular expression given: %s', $this->regularExpression));
    }
    return $match === 1;
}
RSS feed
Powered by Drupal