PHP Class QCheck\Annotation

Afficher le fichier Open project: steos/php-quickcheck

Méthodes publiques

Méthode Description
check ( callable $f, callable $p = null, integer $n = 10 ) : array Determine the generators needed to test the function $f and then use the predicate $p to assert correctness.
getReflection ( callable $f ) : ReflectionFunction | ReflectionMethod Return the correct reflection class for the given callable.
register ( string $type, Generator $generator ) Associate a generator to a given type.
types ( callable $f ) : array Return the types for the given callable.

Method Details

check() public static méthode

If $p is omitted, will simply check that $f returns true for each generated values.
public static check ( callable $f, callable $p = null, integer $n = 10 ) : array
$f callable The function to test
$p callable The predicate
$n integer number of iteration
Résultat array

getReflection() public static méthode

Return the correct reflection class for the given callable.
public static getReflection ( callable $f ) : ReflectionFunction | ReflectionMethod
$f callable
Résultat ReflectionFunction | ReflectionMethod

register() public static méthode

Associate a generator to a given type.
public static register ( string $type, Generator $generator )
$type string
$generator Generator Tĥe generator associated with the type

types() public static méthode

Return the types for the given callable.
public static types ( callable $f ) : array
$f callable
Résultat array