PHP Class QCheck\Annotation

显示文件 Open project: steos/php-quickcheck

Public Methods

Method 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 method

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
return array

getReflection() public static method

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

register() public static method

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 method

Return the types for the given callable.
public static types ( callable $f ) : array
$f callable
return array