UnderstudyInterceptor
Rasuvaeff\Understudy\Testo\UnderstudyInterceptor
Class — Package: rasuvaeff/understudy-testo — Source — Version: v0.1.3
Implements: Testo\Pipeline\Middleware\TestRunInterceptor, Testo\Pipeline\Interceptor
Ends every test with understudy's own bookkeeping done for it.
After a plain test that finished on its own the context is verified: an expect() the code under test never made turns the run into a failure. A failing or skipped body keeps its original outcome — verification would only mask it. Whatever the kind of test and whatever its outcome, the context is reset, so nothing can leak a double into the next test.
The verification itself is counted into the test's assertions metric and appended to the collected Testo\Assert\TestState, so it is visible to anything reading the result. It is absent from the rendered assert-history block: the collector renders that text before returning, and this interceptor is outer to it, so the record simply does not exist yet at rendering time.
This interceptor sits just outside Testo's assert collector: that is where the collected Testo\Assert\TestState is already attached to the result and can be appended to through its public surface — the collector's static state is internal to Testo\Assert and rightly closed to adapters.
Constructor
__construct(
bool $strictStubs = false,
)| Parameter | Type | Default | Description |
|---|---|---|---|
$strictStubs | bool | false |
Methods
runTest()
runTest(
\Testo\Core\Context\TestInfo $info,
callable $next,
): Testo\Core\Context\TestResultDocumentation inherited from Testo\Pipeline\Middleware\TestRunInterceptor.
$info— Information about the test to be run.$next— Next interceptor or core logic to run the test.