|
file-fetcher
|
Constraint that asserts that the array it is evaluated for has a given key.
Uses array_key_exists() to check if the key is found in the input array, if not found the evaluation fails.
The array key is passed in the constructor.
Public Member Functions | |
| __construct ($key) | |
| toString () | |
Public Member Functions inherited from PHPUnit\Framework\Constraint\Constraint | |
| evaluate ($other, string $description='', bool $returnResult=false) | |
| count () | |
Protected Member Functions | |
| matches ($other) | |
| failureDescription ($other) | |
Protected Member Functions inherited from PHPUnit\Framework\Constraint\Constraint | |
| exporter () | |
| fail ($other, $description, ComparisonFailure $comparisonFailure=null) | |
| additionalFailureDescription ($other) | |
| PHPUnit\Framework\Constraint\ArrayHasKey::__construct | ( | $key | ) |
| int | string | $key |
|
protected |
Returns the description of the failure
The beginning of failure messages is "Failed asserting that" in most cases. This method should return the second part of that sentence.
| mixed | $other | evaluated value or object |
Reimplemented from PHPUnit\Framework\Constraint\Constraint.
|
protected |
Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.
| mixed | $other | value or object to evaluate |
Reimplemented from PHPUnit\Framework\Constraint\Constraint.
| PHPUnit\Framework\Constraint\ArrayHasKey::toString | ( | ) |
Returns a string representation of the constraint.
Implements PHPUnit\Framework\SelfDescribing.
1.8.17