function ExceptionMessageMatchesRegularExpression::matches
Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.
Throws
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\ConstraintCode
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;
}