PHP 클래스 SimpleCallSchedule, simpletest

Specific time settings trump lasting ones, otherwise the most recently added will mask an earlier match.
파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
__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.