These docs have moved. The package is frozen at 2.8.1; the current documentation lives on the family site, property-testing. If the redirect did not fire, open the migration guide.
Skip to content

Property

Rasuvaeff\PropertyTesting\Property

ClassSource

Marks a test method as a property: the PropertyInterceptor takes over, generating random arguments from a generators method until the property has completed $runs successful checks or exhausted its discard budget.

Attribute arguments in PHP must be constant expressions, so the generators cannot be passed inline. Instead name a method (on the same test case) that returns array<string, ArbitraryInterface>, keyed by parameter name. When $generators is null the runner falls back to a method named <testMethod>Generators.

Properties

PropertyTypeReadonly
runsintyes
seed?intyes
generators?stringyes
maxShrinks?intyes
examples?stringyes
maxDiscards?intyes
timeoutMs?intyes
budgetMs?intyes