\PHPUnit_Framework_Constraint_PCREMatch

Constraint that asserts that the string it is evaluated for matches a regular expression.

Checks a given value using the Perl Compatible Regular Expression extension
in PHP. The pattern is matched by executing preg_match().

The pattern string passed in the constructor.

Synopsis

class PHPUnit_Framework_Constraint_PCREMatch extends PHPUnit_Framework_Constraint {
  • // Inherited members from PHPUnit_Framework_Constraint
  • protected $exporter;
}

Hierarchy

Violations

Checkstyle

Line Column Severity Message
65 1 error Each class must be in a namespace of at least one level (a top-level vendor name)
65 1 error Class name "PHPUnit_Framework_Constraint_PCREMatch" is not in camel caps format

Members

protected

  • $exporter
  • $pattern — string

Methods

protected

  • matches() — Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.

public

Inherited from PHPUnit_Framework_Constraint

protected

  • additionalFailureDescription() — Return additional failure description where needed
  • fail() — Throws an exception for the given compared value and test description
  • failureDescription() — Returns the description of the failure
  • matches() — Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.

public

  • count() — Counts the number of constraint elements.
  • evaluate() — Evaluates the constraint for parameter $other

History