Skip to content

ConstraintActionHandlesMethod

Constraint that checks if an Action handles an expected request method.

The Action instance is passed to the constructor.

class ConstraintActionHandlesMethod extends BaseConstraintBecausePhpunitSucksAtBackwardsCompatibility

ExtendsBaseConstraintBecausePhpunitSucksAtBackwardsCompatibility
Since1.0.0
SourceTesting/PHPUnit/Constraint/ConstraintActionHandlesMethod.php

public function __construct(Action $actionInstance, bool $acceptGeneric = true): mixed

Class constructor.

ParameterTypeDescription
$actionInstanceActionInstance of the Action to test.
$acceptGenericboolWhether generic execute methods should be accepted.

Returns mixed

MethodDescription
matches(mixed $other): boolEvaluates the constraint for parameter $other.
toString(): stringReturns a string representation of the constraint.

public function matches(mixed $other): bool

Evaluates the constraint for parameter $other.

Value or object to evaluate.

ParameterTypeDescription
$othermixedValue or object to evaluate.

Returns bool — The result of the evaluation.

public function toString(): string

Returns a string representation of the constraint.

Returns string — The string representation.

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
count()ConstraintCounts the number of constraint elements.
evaluate()BaseConstraintBecausePhpunitSucksAtBackwardsCompatibilityOverridden function to cover differences between PHPUnit 3.5 and 3.6.