- \PHPUnit_Framework_Constraint
- \PHPUnit_Framework_Constraint_PCREMatch
- \PHPUnit_Framework_Constraint_StringMatches
- \PHPUnit_Framework_Constraint_PCREMatch
class (none) \ PHPUnit_Framework_Constraint_StringMatches
- All implemented interfaces:
- Countable, PHPUnit_Framework_SelfDescribing
...
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. (from PHPUnit_Framework_Constraint_PCREMatch)
Method Summary
Name | Description |
---|---|
__construct($string) | |
additionalFailureDescription($other) | Return additional failure description where needed |
createPatternFromFormat($string) | |
failureDescription($other) | Returns the description of the failure |
Inherited Method Summary
Name | Description |
---|---|
count() | Counts the number of constraint elements. (from PHPUnit_Framework_Constraint) |
evaluate($other, $description = "", $returnResult = false) | Evaluates the constraint for parameter $other (from PHPUnit_Framework_Constraint) |
fail($other, $description, ComparisonFailure $comparisonFailure = null) | Throws an exception for the given compared value and test description (from PHPUnit_Framework_Constraint) |
matches($other) | Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise. (from PHPUnit_Framework_Constraint_PCREMatch) |
toString() | Returns a string representation of the constraint. (from PHPUnit_Framework_Constraint_PCREMatch) |
public function __construct($string)
- Overrides:
- __construct()
- Parameters:
string
- $string
protected function additionalFailureDescription($other)
Return additional failure description where needed (from additionalFailureDescription)
The function can be overridden to provide additional failure information like a diff (from additionalFailureDescription)
- Overrides:
- additionalFailureDescription($other)
- Parameters:
mixed
- $other Evaluated value or object.- Returns:
- string
protected function createPatternFromFormat($string)
protected function failureDescription($other)
Returns the description of the failure (from failureDescription)
The beginning of failure messages is "Failed asserting that" in most cases. This method should return the second part of that sentence.
To provide additional failure information additionalFailureDescription can be used. (from failureDescription)
- Overrides:
- failureDescription($other)
- Parameters:
mixed
- $other Evaluated value or object.- Returns:
- string