Skip to content

ConstraintViewHandlesOutputType

Constraint that checks if a View handles an expected Output Type.

The View instance is passed to the constructor.

class ConstraintViewHandlesOutputType extends BaseConstraintBecausePhpunitSucksAtBackwardsCompatibility

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

public function __construct(View $viewInstance, bool $acceptGeneric = false): mixed

constructor

Whether generic execute methods should be accepted.

ParameterTypeDescription
$viewInstanceViewInstance of the View 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.