API reference
Generated by reflection (docs/scripts/reflect-api.php) over all five packages' src/, not written by hand — every signature, parameter and default value here is read straight from the code, not transcribed from it. Only @api-annotated types get a page; @internal classes are implementation detail and stay undocumented on purpose.
| Section | What is in it |
|---|---|
| Functions | the 4 free functions that are the primary surface |
| Exceptions | every @api type that implements Throwable |
| Static analysis rules | the 5 PHPStan identifiers and the Psalm issue type — the whole contract of two packages that have no @api class |
Engine
| Type | Kind | Summary |
|---|---|---|
Arg | class | Argument matchers, usable only inside a specification closure: |
Captor | class | A typed argument captor, built by Arg::captor(). |
Cardinality | class | How many times a call is allowed to happen. |
AmbiguousDefaultFactory | class | Two registered default factories are equally close to the requested type. |
BypassUnavailable | class | bypassFinals() cannot do what was asked of it. |
CannotWire | class | wire() cannot build the subject, or cannot decide what to pass it. |
ConflictingExpectation | class | A when() or expect() names a call another registration already specifies, and the two would… |
ContextOwnershipViolation | class | Configuration and verification belong to the context that created a double. |
ForgottenDouble | class | A double outlived the context that created it — almost always a double kept in a static property… |
ForwardingTargetMismatch | class | The instance offered as a forwarding target does not satisfy what the double stands in for. |
InvalidCallSpecification | class | The closure handed to when()/verify()/calls() did not describe one call the way a specification… |
InvalidDefaultValue | class | A registered default factory produced a value the contract cannot hold. |
MatcherLeaked | class | A matcher reached a real call instead of a specification closure. |
NeverMethodCalled | class | A method declared : never was called without an expectation that throws. |
NoDefaultValue | class | A loose understudy had to answer a call, but the declared return type has no safe default. |
NothingCaptured | class | Captor::last() was read before any matched call carried a value through its capture() argument. |
OriginalCallUnavailable | class | callOriginal() was asked to delegate, and there is nothing to delegate to. |
OriginalReturnTypeViolation | class | A forwarded call returned an object the double cannot stand in for. |
OutcomeUnavailable | class | An invocation's outcome was read as the wrong kind: a returned value asked of a call that threw. |
StrictModeViolation | class | A strict understudy received a call no expectation matched. |
UnderstudyError | interface | Implemented by every exception this library throws, so a test can catch misuse of Understudy… |
UnsupportedTarget | class | The requested target cannot be doubled, and no option would make it work without the user changing… |
VerificationFailed | class | A verification about what the code under test did (or did not) do failed. |
ExpectBuilder | class | Configures a call the code under test is expected to make. |
FailureKind | enum | What kind of verification claim a VerificationFailure reports. |
Invocation | class | One recorded call on an understudy. |
Outcome | class | How one call ended: with a value or with a throwable. |
Mode | enum | How an understudy answers a call no expectation matched. |
Understudy | class | The whole public surface, as static methods so that an understudy itself can stay free of service… |
VerificationFailure | class | The structured half of one verification failure — the same facts the rendered message states,… |
WhenBuilder | class | Configures what a stubbed call does. |
Testo adapter
| Type | Kind | Summary |
|---|---|---|
UnderstudyInterceptor | class | Ends every test with understudy's own bookkeeping done for it. |
UnderstudyPlugin | class | Registers UnderstudyInterceptor so every test of the suite ends with understudy's own bookkeeping… |
PHPUnit adapter
| Type | Kind | Summary |
|---|---|---|
UnderstudyPHPUnitIntegration | trait | Ends every PHPUnit test with understudy's own bookkeeping done for it. |
Psalm plugin
| Type | Kind | Summary |
|---|---|---|
UnderstudyMisuse | class | A specification that cannot mean what it says. |
Plugin | class | Entry point registered through extra.psalm.pluginClass, so `vendor/bin/psalm-plugin enable… |