Skip to content

VerificationFailed

Rasuvaeff\Understudy\Exception\VerificationFailed

ClassPackage: rasuvaeff/understudySourceVersion: v0.4.1

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

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.