Skip to content

VerificationFailed ​

Rasuvaeff\Understudy\Exception\VerificationFailed

Class — Package: rasuvaeff/understudy — Source — Version: v1.1.0-1-g6ed023f

Extends: RuntimeException

Implements: Throwable, Stringable, Exception\UnderstudyError

A verification about what the code under test did (or did not) do failed.

This is the one exception that reports on the tested code rather than on misuse of Understudy, so adapters map it to a test failure.

The message is the rendered report for a human; Exception\failures() carries the same facts as VerificationFailure records for tooling. Both are built from one list — there is no path where they disagree.

Constructor ​

php
__construct(
    string $message,
    list<\VerificationFailure> $failures,
)
ParameterTypeDefaultDescription
$messagestringrequired
$failureslist<\VerificationFailure>required

Methods ​

of() ​

php
static of(non-empty-list<\VerificationFailure> $failures): self

Builds a verification failure from its structured records.

failures() ​

php
failures(): array

Every failure this exception reports, in the order the message states them. Non-empty whenever this exception was thrown by Understudy.