Skip to content

PropertyDefinition ​

Rasuvaeff\PropertyTesting\Runner\PropertyDefinition

Class — Package: property-testing-core — Source — Version: v1.0.0-1-g88fdee2

One property, fully resolved for the engine: no attribute, no reflection, no environment. An adapter builds it from its own conventions (Testo's #[Property] + <method>Generators(), a PHPUnit fluent call, a bare CLI script) and hands it to PropertyRunner.

Constructor ​

php
__construct(
    string $id,
    string $name,
    array<string,\ArbitraryInterface> $generators,
    list<string> $parameterNames,
    Runner\PropertyConfig $config = new \Rasuvaeff\PropertyTesting\Runner\PropertyConfig(),
    list<list> $examples = [],
    bool $replayRegressions = true,
)
ParameterTypeDefaultDescription
$idstringrequiredStable identity of the property (Class::method under Testo) — keys the events and the regression corpus.
$namestringrequiredDisplay name used in failure messages (the bare method name under Testo).
$generatorsarray<string,\ArbitraryInterface>requiredOne generator per parameter, keyed by name.
$parameterNameslist<string>requiredThe property body's parameters, in declaration order.
$configRunner\PropertyConfignew \Rasuvaeff\PropertyTesting\Runner\PropertyConfig()
$exampleslist<list>[]Fixed positional argument tuples run before the random phase.
$replayRegressionsbooltrueWhether recorded corpus entries replay before the random phase. An adapter turns this off when the property pins its own seed, so the pinned reproducibility wins over the corpus.