Skip to content

UnderstudyPlugin ​

Rasuvaeff\Understudy\Testo\UnderstudyPlugin

Class — Package: rasuvaeff/understudy-testo — Source — Version: v1.0.0

Implements: Testo\Common\PluginConfigurator

Registers UnderstudyInterceptor so every test of the suite ends with understudy's own bookkeeping done for it: expectations are verified after a passing body and the context is dropped either way.

php
// testo.php
new SuiteConfig(
    name: 'Unit',
    location: ['tests'],
    plugins: [new UnderstudyPlugin()],
);

With strictStubs: true a stub that was never called fails its test too.

Constructor ​

php
__construct(
    bool $strictStubs = false,
)
ParameterTypeDefaultDescription
$strictStubsboolfalse

Methods ​

configure() ​

php
configure(Internal\Container\Container $container): void

Registers the Understudy interceptor with Testo's interceptor collector.