UnderstudyPlugin
Rasuvaeff\Understudy\Testo\UnderstudyPlugin
Class — Package: rasuvaeff/understudy-testo — Source — Version: v1.2.1
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. #[StrictStubs] / #[StrictStubs(false)] from rasuvaeff/understudy on a test class or method overrides the suite's setting there: the method wins over its class, the class over this setting.
Constructor
php
__construct(
bool $strictStubs = false,
)| Parameter | Type | Default | Description |
|---|---|---|---|
$strictStubs | bool | false |
Methods
configure()
php
configure(Internal\Container\Container $container): voidRegisters the Understudy interceptor with Testo's interceptor collector.