PHP Класс SimpleCallSchedule, simpletest

Specific time settings trump lasting ones, otherwise the most recently added will mask an earlier match.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
replaceWildcards ( array $args ) : array Replaces wildcard matches with wildcard expectations in the argument list.

Описание методов

__construct() публичный Метод

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

expectArguments() публичный Метод

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() публичный Метод

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() публичный Метод

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() защищенный Метод

Replaces wildcard matches with wildcard expectations in the argument list.
protected replaceWildcards ( array $args ) : array
$args array Raw argument list.
Результат array Argument list with expectations.

respond() публичный Метод

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.
Результат mixed The result of the action.