PHP Class SimpleCallSchedule, simpletest

Specific time settings trump lasting ones, otherwise the most recently added will mask an earlier match.
Afficher le fichier Open project: simpletest/simpletest Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( ) Sets up an empty response schedule. Creates an empty call map.
expectArguments ( string $method, array $args, string $message ) Sets up an expectation on the argument list.
register ( string $method, array $args, SimpleAction $action ) Stores an action against a signature that will always fire unless masked by a time specific one.
registerAt ( integer $step, string $method, array $args, SimpleAction $action ) Stores an action against a signature that will fire at a specific time in the future.
respond ( integer $step, string $method, array $args ) : mixed Actually carry out the action stored previously, if the parameters match.

Méthodes protégées

Méthode Description
replaceWildcards ( array $args ) : array Replaces wildcard matches with wildcard expectations in the argument list.

Method Details

__construct() public méthode

Sets up an empty response schedule. Creates an empty call map.
public __construct ( )

expectArguments() public méthode

Sets up an expectation on the argument list.
public expectArguments ( string $method, array $args, string $message )
$method string Method to test.
$args array Bare arguments or list of expectation objects.
$message string Failure message.

register() public méthode

Stores an action against a signature that will always fire unless masked by a time specific one.
public register ( string $method, array $args, SimpleAction $action )
$method string Method name.
$args array Calling parameters.
$action SimpleAction Actually simpleByValue, etc.

registerAt() public méthode

Stores an action against a signature that will fire at a specific time in the future.
public registerAt ( integer $step, string $method, array $args, SimpleAction $action )
$step integer delay of calls to this method, 0 is next.
$method string Method name.
$args array Calling parameters.
$action SimpleAction Actually SimpleByValue, etc.

replaceWildcards() protected méthode

Replaces wildcard matches with wildcard expectations in the argument list.
protected replaceWildcards ( array $args ) : array
$args array Raw argument list.
Résultat array Argument list with expectations.

respond() public méthode

Actually carry out the action stored previously, if the parameters match.
public respond ( integer $step, string $method, array $args ) : mixed
$step integer Time of call.
$method string Method name.
$args array The parameters making up the rest of the call.
Résultat mixed The result of the action.